The current draft of JLS 2e drops the check for access to inherited members
of an inner class that hide a member declared in an enclosing class. This
check is required by the current innerclasses spec, and implemented by the
compiler. The check should be removed.
----------
This refers to the now-obsolete last sentence of the following excerpt from the inner class specification:
Any inherited member m of a subclass C is in scope within the body of C, including any inner classes within C. If C itself is an inner
class, there may be definitions of the same kind (variable, method, or type) for m in enclosing scopes. (The scopes may be blocks,
classes, or packages.) In all such cases, the inherited member m hides the other definitions of m. Additionally, unless the hidden
definition is a package member, the simple name m is illegal; the programmer must write C.this.m.
neal.gafter@Eng 2000-11-20
of an inner class that hide a member declared in an enclosing class. This
check is required by the current innerclasses spec, and implemented by the
compiler. The check should be removed.
----------
This refers to the now-obsolete last sentence of the following excerpt from the inner class specification:
Any inherited member m of a subclass C is in scope within the body of C, including any inner classes within C. If C itself is an inner
class, there may be definitions of the same kind (variable, method, or type) for m in enclosing scopes. (The scopes may be blocks,
classes, or packages.) In all such cases, the inherited member m hides the other definitions of m. Additionally, unless the hidden
definition is a package member, the simple name m is illegal; the programmer must write C.this.m.
neal.gafter@Eng 2000-11-20
- duplicates
-
JDK-4320844 Compiler should omit ambiguity check for members inherited into an inner class
- Closed