Community
Participate
Working Groups
The following ASTNodes have a wrong scope in their traverse methods: - FieldDeclaration - Initializer both take a MethodScope but should take a ClassScope
Fields (and initializers) do not have their own scope, but rather share an intermediate initializer scope (static fields/initializers are grouped under a static initializer scope). This extra scope is inserted in between the classscope and the field/initializer (for the latter the blockscope of the initializer block is a child of the initializer scope). Initializer scope happen to be implemented as MethodScope, this is what you are seeing (but they answer true to #isInsideInitializer()).