Fix syntax support for dynamic member access.
Covers syntax like:
- A::${$foo}
- A::$var::${$foo}
- A::$var->${$foo}
BUG: 400294
FIXED-IN: 5.3.1
| kfunk |
Fix syntax support for dynamic member access.
Covers syntax like:
BUG: 400294
FIXED-IN: 5.3.1
| Automatic diff as part of commit; lint not applicable. |
| Automatic diff as part of commit; unit tests not applicable. |
| duchain/expressionvisitor.cpp | ||
|---|---|---|
| 725 | You already dereference node->staticProperty->staticProperty before in line 700; so this if-stmt would be always true(?). Doesn't make sense to me. | |
Restructure if-statements in visitStaticMember.
Remove commented code from unit tests.
| duchain/expressionvisitor.cpp | ||
|---|---|---|
| 725 | You're right. I restructured it to make things clearer. | |
| duchain/expressionvisitor.cpp | ||
|---|---|---|
| 790 | With the current grammer, if there's staticProperty, there's also a staticProperty->staticProperty, so conceptually we don't need to check for both right now. However, the grammar can change, so it's probably good to be safe. | |
I wonder if a couple of auto* element = it->element, auto* staticProperty = it->element->staticProperty sprayed throughout the code base would help making all of this a bit more readable...
| duchain/tests/uses.cpp | ||
|---|---|---|
| 1423 | Minor, for future: you can use C++11-style initialization here: QList<RangeInRevision>{...} More TODO: Should be a QVector<RangeInRevision> for performance reasons. | |