/* * @test /nodynamiccopyright/ * @bug 8062373 * * @summary Test diamond + anonymous classes with non-denotable types * @author mcimadamore * @compile/fail/ref=Neg12.out Neg12.java -XDrawDiagnostics * */ class Neg12 { static class Foo { Foo(X x) { } } static class DoubleFoo { DoubleFoo(X x,Y y) { } } static class TripleFoo { TripleFoo(X x,Y y,Z z) { } } Foo fi = new Foo<>(1); Foo fw = new Foo<>(fi) {}; // Error. Foo fw1 = new Foo<>(fi); // OK. Foo fd = new Foo<>(3.0); DoubleFoo dw = new DoubleFoo<>(fi,fd) {}; // Error. DoubleFoo dw1 = new DoubleFoo<>(fi,fd); // OK. Foo fs = new Foo<>("one"); TripleFoo tw = new TripleFoo<>(fi,fd,fs) {}; // Error. TripleFoo tw1 = new TripleFoo<>(fi,fd,fs); // OK. }