/* * @test /nodynamiccopyright/ * @bug 6840638 * * @summary Project Coin: Improved Type Inference for Generic Instance Creation (aka 'diamond') * @author mcimadamore * @compile/fail/ref=Neg04.out Neg04.java -source 1.7 -XDrawDiagnostics * */ class Neg04 { void test() { class Foo { Foo(V x) {} Foo(V x, Z z) {} } Foo n1 = new Foo<>(""); //new Foo created Foo n2 = new Foo<>(""); //new Foo created Foo n3 = new Foo<>(""); //new Foo created Foo n4 = new Foo<>(""); //new Foo created Foo n5 = new Foo<>(""){}; //new Foo created Foo n6 = new Foo<>(""){}; //new Foo created Foo n7 = new Foo<>(""){}; //new Foo created Foo n8 = new Foo<>(""){}; //new Foo created Foo n9 = new Foo<>("", ""); //new Foo created Foo n10 = new Foo<>("", ""); //new Foo created Foo n11 = new Foo<>("", ""); //new Foo created Foo n12 = new Foo<>("", ""); //new Foo created Foo n13 = new Foo<>("", ""){}; //new Foo created Foo n14 = new Foo<>("", ""){}; //new Foo created Foo n15 = new Foo<>("", ""){}; //new Foo created Foo n16 = new Foo<>("", ""){}; //new Foo created } }