compilation fails with 'no enclosing instance' error

Liam Miller-Cushon cushon at
Wed Feb 12 17:49:31 PST 2014


I discovered a JDK8-b128 compilation error that does not occur with JDK7:

=== base/ ===
package base;

public class BaseImpl {
  static void foo(Object o) {}

=== ===
class Impl extends base.BaseImpl {
  public void foo(Object o) {}

class MyImpl extends Impl {
  public void m(Object o) {

$ javac base/ error: no enclosing instance of type Impl is in scope

Is this a deliberate change, or a regression? If it's deliberate, the error
message is not very clear.
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the compiler-dev mailing list