< prev index next > test/langtools/tools/javac/SuperInit/EarlyIndirectOuterCapture.java
Print this page
/*
* @test /nodynamiccopyright/
* @bug 8334248
* @summary Invalid error for early construction local class constructor method reference
! * @compile/fail/ref=EarlyIndirectOuterCapture.out -XDrawDiagnostics EarlyIndirectOuterCapture.java
*/
public class EarlyIndirectOuterCapture {
EarlyIndirectOuterCapture() {
/*
* @test /nodynamiccopyright/
* @bug 8334248
* @summary Invalid error for early construction local class constructor method reference
! * @compile EarlyIndirectOuterCapture.java
*/
public class EarlyIndirectOuterCapture {
EarlyIndirectOuterCapture() {
class InnerSuperclass { }
static class InnerOuter extends EarlyIndirectOuterCapture { // accessible
class InnerInnerOuter extends EarlyIndirectOuterCapture { // not accessible
InnerInnerOuter() {
! super(/* which enclosing instance here ? */new InnerSuperclass() { });
}
InnerInnerOuter(boolean b) {
super(InnerOuter.this.new InnerSuperclass() { }); // ok, explicit
}
class InnerSuperclass { }
static class InnerOuter extends EarlyIndirectOuterCapture { // accessible
class InnerInnerOuter extends EarlyIndirectOuterCapture { // not accessible
InnerInnerOuter() {
! super(new InnerSuperclass() { }); // should this be accepted?, InnerSuperclass is not an inner class of InnerInnerOuter
}
InnerInnerOuter(boolean b) {
super(InnerOuter.this.new InnerSuperclass() { }); // ok, explicit
}
< prev index next >