jdk-24/langtools/test/tools/javac/generics/7034511/T7034511b.java
Maurizio Cimadamore defbb67771 7041019: Bogus type-variable substitution with array types with dependencies on accessibility check
Call to upperBound() when performing type-variable substitution on element type leads to unsoundness

Reviewed-by: jjg
2013-07-17 14:14:49 +01:00

17 lines
346 B
Java

/*
* @test /nodynamiccopyright/
* @bug 7034511 7040883 7041019
* @summary Loophole in typesafety
* @compile/fail/ref=T7034511b.out -XDrawDiagnostics T7034511b.java
*/
class T7034511b {
static class MyList<E> {
E toArray(E[] e) { return null; }
}
void test(MyList<?> ml, Object o[]) {
ml.toArray(o);
}
}