-
Bug
-
Resolution: Fixed
-
P4
-
23
-
b07
This program fails to compile:
class Outer {
interface A { }
interface B { }
class Inner1 {
Inner1() {
this(new A() {
class Inner2 {
Inner2() {
this(new B() { { m(); g(); } });
}
Inner2(Object o) { }
}
void m() { }
});
}
Inner1(Object o) { }
}
void g() { }
}
Error is:
error: no enclosing instance of type Outer is in scope
this(new B() { { m(); g(); } });
^
1 error
class Outer {
interface A { }
interface B { }
class Inner1 {
Inner1() {
this(new A() {
class Inner2 {
Inner2() {
this(new B() { { m(); g(); } });
}
Inner2(Object o) { }
}
void m() { }
});
}
Inner1(Object o) { }
}
void g() { }
}
Error is:
error: no enclosing instance of type Outer is in scope
this(new B() { { m(); g(); } });
^
1 error
- relates to
-
JDK-8333313 NullPointerException in lambda instantiating an inner local class in prologue
- Resolved
-
JDK-8333766 Stack overflow with anonymous class in super() parameter
- Resolved
-
JDK-8334037 Local class creation in lambda in pre-construction context crashes javac
- Resolved
- links to
-
Commit(master) openjdk/jdk/9dfcd75e
-
Review(master) openjdk/jdk/19900