/* * @test /nodynamiccopyright/ * @bug 6840638 * * @summary Project Coin: Improved Type Inference for Generic Instance Creation (aka 'diamond') * @author mcimadamore * @compile Pos03.java -source 1.7 * @run main Pos03 * */ public class Pos03 { class Foo { Foo(V x) {} Foo(V x, Z z) {} } void testSimple() { Foo f1 = new Foo<>(1); //new Foo created Foo f2 = new Foo<>(1); //new Foo created Foo f3 = new Foo<>(1); //new Foo created Foo f4 = new Foo<>(1); //new Foo created Foo f5 = new Foo<>(1){}; //new Foo created Foo f6 = new Foo<>(1){}; //new Foo created Foo f7 = new Foo<>(1){}; //new Foo created Foo f8 = new Foo<>(1){}; //new Foo created Foo f9 = new Foo<>(1, ""); //new Foo created Foo f10 = new Foo<>(1, ""); //new Foo created Foo f11 = new Foo<>(1, ""); //new Foo created Foo f12 = new Foo<>(1, ""); //new Foo created Foo f13 = new Foo<>(1, ""){}; //new Foo created Foo f14 = new Foo<>(1, ""){}; //new Foo created Foo f15 = new Foo<>(1, ""){}; //new Foo created Foo f16 = new Foo<>(1, ""){}; //new Foo created } void testQualified_1() { Foo f1 = new Pos03.Foo<>(1); //new Foo created Foo f2 = new Pos03.Foo<>(1); //new Foo created Foo f3 = new Pos03.Foo<>(1); //new Foo created Foo f4 = new Pos03.Foo<>(1); //new Foo created Foo f5 = new Pos03.Foo<>(1){}; //new Foo created Foo f6 = new Pos03.Foo<>(1){}; //new Foo created Foo f7 = new Pos03.Foo<>(1){}; //new Foo created Foo f8 = new Pos03.Foo<>(1){}; //new Foo created Foo f9 = new Pos03.Foo<>(1, ""); //new Foo created Foo f10 = new Pos03.Foo<>(1, ""); //new Foo created Foo f11 = new Pos03.Foo<>(1, ""); //new Foo created Foo f12 = new Pos03.Foo<>(1, ""); //new Foo created Foo f13 = new Pos03.Foo<>(1, ""){}; //new Foo created Foo f14 = new Pos03.Foo<>(1, ""){}; //new Foo created Foo f15 = new Pos03.Foo<>(1, ""){}; //new Foo created Foo f16 = new Pos03.Foo<>(1, ""){}; //new Foo created } void testQualified_2(Pos03 p) { Foo f1 = p.new Foo<>(1); //new Foo created Foo f2 = p.new Foo<>(1); //new Foo created Foo f3 = p.new Foo<>(1); //new Foo created Foo f4 = p.new Foo<>(1); //new Foo created Foo f5 = p.new Foo<>(1){}; //new Foo created Foo f6 = p.new Foo<>(1){}; //new Foo created Foo f7 = p.new Foo<>(1){}; //new Foo created Foo f8 = p.new Foo<>(1){}; //new Foo created Foo f9 = p.new Foo<>(1, ""); //new Foo created Foo f10 = p.new Foo<>(1, ""); //new Foo created Foo f11 = p.new Foo<>(1, ""); //new Foo created Foo f12 = p.new Foo<>(1, ""); //new Foo created Foo f13 = p.new Foo<>(1, ""){}; //new Foo created Foo f14 = p.new Foo<>(1, ""){}; //new Foo created Foo f15 = p.new Foo<>(1, ""){}; //new Foo created Foo f16 = p.new Foo<>(1, ""){}; //new Foo created } public static void main(String[] args) { Pos03 p3 = new Pos03<>(); p3.testSimple(); p3.testQualified_1(); p3.testQualified_2(p3); } }