compilation fails with 'no enclosing instance' error
cushon at google.com
Thu Feb 13 16:57:07 PST 2014
> Filed https://bugs.openjdk.java.net/browse/JDK-8034924.
> - 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...
More information about the compiler-dev