diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SuperAfterStatementsTest.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SuperAfterStatementsTest.java index 970a370daab..402ac2b8e3c 100644 --- a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SuperAfterStatementsTest.java +++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SuperAfterStatementsTest.java @@ -2509,4 +2509,30 @@ public static void main(String... args0) { """}, ""); } + + public void testGH3194_reopen() { + runConformTest(new String[] { + "X.java", + """ + sealed interface A permits X {} + public final class X implements A { + int a = 1; + class One { + int b = 2; + class Two { + int c = 3; + class Three { + int r = a + b + c; + } + } + } + public static void main(String argv[]) { + X x = new X(); + One.Two.Three ci = x.new One().new Two().new Three(); // No enclosing instance of type X is accessible. Must qualify the allocation... + System.out.println(ci.r); + } + } + """ + }); + } }