/* * @test /nodynamiccopyright/ * @bug 6840638 * * @summary Project Coin: Improved Type Inference for Generic Instance Creation (aka 'diamond') * @author mcimadamore * @compile/fail/ref=Neg03.out Neg03.java -source 1.7 -XDrawDiagnostics * */ class Neg03 { class Foo { Foo(V x) {} Foo(V x, Z z) {} } void testSimple() { Foo f1 = new Foo<>(""); //new Foo created Foo f2 = new Foo<>(""); //new Foo created Foo f3 = new Foo<>(""); //new Foo created Foo f4 = new Foo<>(""); //new Foo created Foo f5 = new Foo<>(""){}; //new Foo created Foo f6 = new Foo<>(""){}; //new Foo created Foo f7 = new Foo<>(""){}; //new Foo created Foo f8 = new Foo<>(""){}; //new Foo created Foo f9 = new Foo<>("", ""); //new Foo created Foo f10 = new Foo<>("", ""); //new Foo created Foo f11 = new Foo<>("", ""); //new Foo created Foo f12 = new Foo<>("", ""); //new Foo created Foo f13 = new Foo<>("", ""){}; //new Foo created Foo f14 = new Foo<>("", ""){}; //new Foo created Foo f15 = new Foo<>("", ""){}; //new Foo created Foo f16 = new Foo<>("", ""){}; //new Foo created } void testQualified_1() { Foo f1 = new Neg03.Foo<>(""); //new Foo created Foo f2 = new Neg03.Foo<>(""); //new Foo created Foo f3 = new Neg03.Foo<>(""); //new Foo created Foo f4 = new Neg03.Foo<>(""); //new Foo created Foo f5 = new Neg03.Foo<>(""){}; //new Foo created Foo f6 = new Neg03.Foo<>(""){}; //new Foo created Foo f7 = new Neg03.Foo<>(""){}; //new Foo created Foo f8 = new Neg03.Foo<>(""){}; //new Foo created Foo f9 = new Neg03.Foo<>("", ""); //new Foo created Foo f10 = new Neg03.Foo<>("", ""); //new Foo created Foo f11 = new Neg03.Foo<>("", ""); //new Foo created Foo f12 = new Neg03.Foo<>("", ""); //new Foo created Foo f13 = new Neg03.Foo<>("", ""){}; //new Foo created Foo f14 = new Neg03.Foo<>("", ""){}; //new Foo created Foo f15 = new Neg03.Foo<>("", ""){}; //new Foo created Foo f16 = new Neg03.Foo<>("", ""){}; //new Foo created } void testQualified_2(Neg03 n) { Foo f1 = n.new Foo<>(""); //new Foo created Foo f2 = n.new Foo<>(""); //new Foo created Foo f3 = n.new Foo<>(""); //new Foo created Foo f4 = n.new Foo<>(""); //new Foo created Foo f5 = n.new Foo<>(""){}; //new Foo created Foo f6 = n.new Foo<>(""){}; //new Foo created Foo f7 = n.new Foo<>(""){}; //new Foo created Foo f8 = n.new Foo<>(""){}; //new Foo created Foo f9 = n.new Foo<>("", ""); //new Foo created Foo f10 = n.new Foo<>("", ""); //new Foo created Foo f11 = n.new Foo<>("", ""); //new Foo created Foo f12 = n.new Foo<>("", ""); //new Foo created Foo f13 = n.new Foo<>("", ""){}; //new Foo created Foo f14 = n.new Foo<>("", ""){}; //new Foo created Foo f15 = n.new Foo<>("", ""){}; //new Foo created Foo f16 = n.new Foo<>("", ""){}; //new Foo created } }