compilation fails with 'no enclosing instance' error
vicente.romero at oracle.com
Thu Feb 27 08:41:21 PST 2014
On 27/02/14 16:17, Liam Miller-Cushon wrote:
> IMO, the problem here in hiddenIn() is not that visibility is not
> being considered, this caught in other part of the compiler. The
> problem here is that hiddenIn() was analyzing all the superclasses
> up to Object. This is not necessary to determine if a member is
> hidden or not.
> The implementation of hiddenIn() is also examining all
> superinterfaces. Is that necessary? It's a compile time error for a
> static method to hide an interface method, and that error should get
> caught earlier in the compilation.
> If hiddenIn() was only considering superclasses then it could just
> examine the path between the current class and the member's owner,
> which I think would fix this bug.
Well hiddenIn() is not used for methods only, also fields are considered.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the compiler-dev