Skip to content

Commit 2ecf692

Browse files
ECJ accepts an invalid code when supertype itself is a bound (#4594)
Add test to DubiousOutcomeTest Fixes #4263
1 parent f847cd8 commit 2ecf692

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/DubiousOutcomeTest.java

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,4 +292,27 @@ interface NumberSupplier<N extends Number> {
292292
runner.javacTestOptions = DubiousOutcome.JDK8364144;
293293
runner.runConformTest();
294294
}
295+
public void testGH4263() {
296+
Runner runner = new Runner();
297+
runner.testFiles = new String[] {
298+
"X.java",
299+
"""
300+
class AClass<T> {
301+
AClass(T t) {}
302+
}
303+
interface I<T> {}
304+
class Concrete<T> implements I<T> {}
305+
public class X {
306+
public static void main(String args[]) {
307+
foo(new AClass<I<? super Integer>>(new Concrete<java.io.Serializable>()));
308+
}
309+
static <T extends I<? super String>> String foo(AClass<? super T> ac) {
310+
return "foo";
311+
}
312+
}
313+
"""
314+
};
315+
runner.javacTestOptions = DubiousOutcome.JavacErrorsEclipseNone;
316+
runner.runConformTest();
317+
}
295318
}

0 commit comments

Comments
 (0)