/* * @test /nodynamiccopyright/ * @bug 6840638 * * @summary Project Coin: Improved Type Inference for Generic Instance Creation (aka 'diamond') * @author mcimadamore * @compile Pos01.java -source 1.7 * @run main Pos01 * */ public class Pos01 { Pos01(X x) {} Pos01(X x, Z z) {} void test() { Pos01 p1 = new Pos01<>(1); //new Foo created Pos01 p2 = new Pos01<>(1); //new Foo created Pos01 p3 = new Pos01<>(1); //new Foo created Pos01 p4 = new Pos01<>(1); //new Foo created Pos01 p5 = new Pos01<>(1){}; //new Foo created Pos01 p6 = new Pos01<>(1){}; //new Foo created Pos01 p7 = new Pos01<>(1){}; //new Foo created Pos01 p8 = new Pos01<>(1){}; //new Foo created Pos01 p9 = new Pos01<>(1, ""); //new Foo created Pos01 p10 = new Pos01<>(1, ""); //new Foo created Pos01 p11 = new Pos01<>(1, ""); //new Foo created Pos01 p12 = new Pos01<>(1, ""); //new Foo created Pos01 p13 = new Pos01<>(1, ""){}; //new Foo created Pos01 p14= new Pos01<>(1, ""){}; //new Foo created Pos01 p15 = new Pos01<>(1, ""){}; //new Foo created Pos01 p16 = new Pos01<>(1, ""){}; //new Foo created } public static void main(String[] args) { Pos01 p1 = new Pos01<>(""); p1.test(); } }