/* * @test /nodynamiccopyright/ * @bug 6840638 * * @summary Project Coin: Improved Type Inference for Generic Instance Creation (aka 'diamond') * @author mcimadamore * @compile/fail/ref=Neg02.out Neg02.java -source 1.7 -XDrawDiagnostics * */ class Neg02 { static class Foo { Foo(X x) {} Foo(X 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() { Foo f1 = new Neg02.Foo<>(""); //new Foo created Foo f2 = new Neg02.Foo<>(""); //new Foo created Foo f3 = new Neg02.Foo<>(""); //new Foo created Foo f4 = new Neg02.Foo<>(""); //new Foo created Foo f5 = new Neg02.Foo<>(""){}; //new Foo created Foo f6 = new Neg02.Foo<>(""){}; //new Foo created Foo f7 = new Neg02.Foo<>(""){}; //new Foo created Foo f8 = new Neg02.Foo<>(""){}; //new Foo created Foo f9 = new Neg02.Foo<>("", ""); //new Foo created Foo f10 = new Neg02.Foo<>("", ""); //new Foo created Foo f11 = new Neg02.Foo<>("", ""); //new Foo created Foo f12 = new Neg02.Foo<>("", ""); //new Foo created Foo f13 = new Neg02.Foo<>("", ""){}; //new Foo created Foo f14 = new Neg02.Foo<>("", ""){}; //new Foo created Foo f15 = new Neg02.Foo<>("", ""){}; //new Foo created Foo f16 = new Neg02.Foo<>("", ""){}; //new Foo created } }