compilation fails with 'no enclosing instance' error
Liam Miller-Cushon
cushon at google.com
Thu Feb 27 08:17:40 PST 2014
> 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.
Thanks,
Liam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20140227/a8fc7d21/attachment.html
More information about the compiler-dev
mailing list