test/tools/javac/generics/diamond/8065986/T8065986a.java

Thu, 12 Nov 2015 22:10:46 +0000

author
mcimadamore
date
Thu, 12 Nov 2015 22:10:46 +0000
changeset 3002
0caab0d65a04
permissions
-rw-r--r--

8065986: Compiler fails to NullPointerException when calling super with Object<>()
Summary: Missing POLY kind selector on recursive constructor calls with poly arguments
Reviewed-by: vromero

mcimadamore@3002 1 /*
mcimadamore@3002 2 * @test /nodynamiccopyright/
mcimadamore@3002 3 * @bug 8065986
mcimadamore@3002 4 *
mcimadamore@3002 5 * @summary Compiler fails to NullPointerException when calling super with Object<>()
mcimadamore@3002 6 * @compile/fail/ref=T8065986a.out T8065986a.java -XDrawDiagnostics
mcimadamore@3002 7 *
mcimadamore@3002 8 */
mcimadamore@3002 9 import java.util.ArrayList;
mcimadamore@3002 10
mcimadamore@3002 11 class T8065986a {
mcimadamore@3002 12 T8065986a() {
mcimadamore@3002 13 super(new Object<>());
mcimadamore@3002 14 }
mcimadamore@3002 15
mcimadamore@3002 16 T8065986a(boolean b) {
mcimadamore@3002 17 super(new ArrayList<>());
mcimadamore@3002 18 }
mcimadamore@3002 19
mcimadamore@3002 20 T8065986a(boolean b1, boolean b2) {
mcimadamore@3002 21 super(()->{});
mcimadamore@3002 22 }
mcimadamore@3002 23
mcimadamore@3002 24 T8065986a(boolean b1, boolean b2, boolean b3) {
mcimadamore@3002 25 super(T8065986a::m);
mcimadamore@3002 26 }
mcimadamore@3002 27
mcimadamore@3002 28 T8065986a(boolean cond, Object o1, Object o2) {
mcimadamore@3002 29 super(cond ? o1 : o2);
mcimadamore@3002 30 }
mcimadamore@3002 31
mcimadamore@3002 32 static void m() { }
mcimadamore@3002 33 }

mercurial