You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: org.eclipse.jdt.core.compiler.batch/src/org/eclipse/jdt/internal/compiler/ast/ExplicitConstructorCall.java
+8
Original file line number
Diff line number
Diff line change
@@ -378,6 +378,14 @@ public void resolve(BlockScope scope) {
Copy file name to clipboardexpand all lines: org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/SuperAfterStatementsTest.java
+103
Original file line number
Diff line number
Diff line change
@@ -3220,4 +3220,107 @@ public class X {
3220
3220
----------
3221
3221
""");
3222
3222
}
3223
+
publicvoidtestGH3687c() {
3224
+
runNegativeTest(newString[] {
3225
+
"X.java",
3226
+
"""
3227
+
import java.util.function.IntSupplier;
3228
+
@SuppressWarnings("unused")
3229
+
public class X {
3230
+
public static void main(String argv[]) {
3231
+
class Parent {
3232
+
int value;
3233
+
Parent(int i) {
3234
+
this.value = i;
3235
+
}
3236
+
}
3237
+
class Outer {
3238
+
static IntSupplier supplier = () -> {
3239
+
class InnerLocal extends Parent {
3240
+
InnerLocal() {
3241
+
super(10);
3242
+
}
3243
+
}
3244
+
return new InnerLocal().value;
3245
+
};
3246
+
}
3247
+
System.out.println(Outer.supplier.getAsInt());
3248
+
}
3249
+
}"""
3250
+
},
3251
+
"----------\n" +
3252
+
"1. ERROR in X.java (at line 15)\n" +
3253
+
" super(10);\n" +
3254
+
" ^^^^^^^^^^\n" +
3255
+
"Cannot instantiate local class \'Parent\' in a static context\n" +
0 commit comments