T8062977.java revision 2705:4235749f4989
1/* 2 * @test /nodynamiccopyright/ 3 * @bug 8062977 4 * @summary Inference: NullPointerException during bound incorporation 5 * 6 * @compile/fail/ref=T8062977.out -XDrawDiagnostics T8062977.java 7 */ 8 9import java.util.List; 10 11class T8062977 { 12 <T extends B, B> T m(Class<B> cb) { return null; } 13 14 void test1(Class<Iterable<?>> cb) { 15 List<Integer>[] r1 = m(cb); //fail 16 List<Integer> r2 = m(cb); //ok 17 } 18 19 void test2(Class<Iterable<?>[]> cb) { 20 List<Integer>[] r1 = m(cb); //ok 21 List<Integer> r2 = m(cb); //fail 22 } 23 24 void test3(Class<Iterable<?>[][]> cb) { 25 List<Integer>[][] r1 = m(cb); //ok 26 List<Integer>[] r2 = m(cb); //fail 27 List<Integer> r3 = m(cb); //fail 28 } 29} 30