junichi11 commented on code in PR #8227:
URL: https://github.com/apache/netbeans/pull/8227#discussion_r1948120436
##########
php/php.editor/src/org/netbeans/modules/php/editor/model/impl/ClassScopeImpl.java:
##########
@@ -379,32 +372,145 @@ public Collection<? extends MethodScope>
getInheritedMethods() {
@Override
public Collection<? extends FieldElement> getInheritedFields() {
Set<FieldElement> allFields = new HashSet<>();
- IndexScope indexScope = ModelUtils.getIndexScope(this);
- ElementQuery.Index index = indexScope.getIndex();
- org.netbeans.modules.php.editor.api.elements.ElementFilter
filterForPrivate =
org.netbeans.modules.php.editor.api.elements.ElementFilter.forPrivateModifiers(false);
+ Map<String, FieldElement> fieldNames = new HashMap<>();
Set<ClassScope> superClasses = new HashSet<>(getSuperClasses());
for (ClassScope classScope : superClasses) {
- Set<org.netbeans.modules.php.editor.api.elements.FieldElement>
indexedFields = filterForPrivate.filter(index.getAlllFields(classScope));
- for (org.netbeans.modules.php.editor.api.elements.FieldElement
field : indexedFields) {
- allFields.add(new FieldElementImpl(classScope, field));
Review Comment:
This implementation has a bug:
All inherited fields are added to `classScope` as elements.
If `classScope.getDeclaredFields()` is invoked, inherited fields may also be
got.
https://github.com/apache/netbeans/blob/51fa1325cad00b4d9fc728ae207ec9657cabb31e/php/php.editor/src/org/netbeans/modules/php/editor/model/impl/ClassScopeImpl.java#L307-L318
##########
php/php.editor/tools/ASTPHP5Parser.cup:
##########
@@ -5360,23 +5435,13 @@ T_OPEN_RECT:o dim_offset:index T_CLOSE_RECT:end
{:
RESULT = new ArrayDimension(oleft, endright, index,
ArrayDimension.Type.VARIABLE_ARRAY);
:}
-
-| T_CURLY_OPEN:o dim_offset:index T_CURLY_CLOSE:end
-{:
- RESULT = new ArrayDimension(oleft, endright, index,
ArrayDimension.Type.VARIABLE_HASHTABLE);
-:}
Review Comment:
Note: Curly braces array access (`{}` e.g. `$array{1}`, `$array{'key'}`) can
use no longer.
Because a conflict occurs in the following case:
```php
"string"{1};
public string $prop = "string" {
get => $this->prop;
set {}
}
```
##########
php/php.editor/src/org/netbeans/modules/php/editor/verification/ArrayDimensionSyntaxSuggestionHint.java:
##########
Review Comment:
This no longer work.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists