test/tools/javac/generics/7034511/T7034511b.java

Thu, 31 Aug 2017 15:17:03 +0800

author
aoqi
date
Thu, 31 Aug 2017 15:17:03 +0800
changeset 2525
2eb010b6cb22
parent 1901
db2c539819dd
parent 0
959103a6100f
permissions
-rw-r--r--

merge

aoqi@0 1 /*
aoqi@0 2 * @test /nodynamiccopyright/
aoqi@0 3 * @bug 7034511 7040883 7041019
aoqi@0 4 * @summary Loophole in typesafety
aoqi@0 5 * @compile/fail/ref=T7034511b.out -XDrawDiagnostics T7034511b.java
aoqi@0 6 */
aoqi@0 7
aoqi@0 8 class T7034511b {
aoqi@0 9 static class MyList<E> {
aoqi@0 10 E toArray(E[] e) { return null; }
aoqi@0 11 }
aoqi@0 12
aoqi@0 13 void test(MyList<?> ml, Object o[]) {
aoqi@0 14 ml.toArray(o);
aoqi@0 15 }
aoqi@0 16 }

mercurial