compilation fails with 'no enclosing instance' error

Liam Miller-Cushon cushon at google.com
Thu Feb 13 16:57:07 PST 2014


>
> Filed https://bugs.openjdk.java.net/browse/JDK-8034924.
>

Thanks!


> - The compile-time error appears (incorrectly) whether the static method
> in base.BaseImpl is package access or private. But if the static method is
> public, then everything works fine: Impl.foo(Object) attempts to override
> base.BaseImpl.foo(Object), and a compile-time error occurs because an
> instance method cannot override a static method.
>

I think the culprit is that Symbol.hiddenIn(...) doesn't consider
visibility. It's incorrectly reporting Impl.foo() as being hidden by
base.BaseImpl.foo(), which causes an error during lowering when a qualified
base class reference is being synthesized for the invocation.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/compiler-dev/attachments/20140213/daa01211/attachment.html 


More information about the compiler-dev mailing list