compilation fails with 'no enclosing instance' error

Vicente-Arturo Romero-Zaldivar vicente.romero at
Thu Feb 27 07:32:45 PST 2014


On 14/02/14 00:57, Liam Miller-Cushon wrote:
>     Filed
> 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:
> attempts to override,
>     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 as being hidden by 
>, which causes an error during lowering when a 
> qualified base class reference is being synthesized for the invocation.

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.

-------------- next part --------------
An HTML attachment was scrubbed...

More information about the compiler-dev mailing list