Neg22.java revision 3040:e6fcc24b6d14
1/* 2 * @test /nodynamiccopyright/ 3 * @bug 8132535 4 * @summary Compiler fails with diamond anonymous class creation with intersection bound of enclosing class. 5 * @compile/fail/ref=Neg22.out Neg22.java -XDrawDiagnostics 6 */ 7 8public class Neg22 { 9 10 class Outer<X extends Runnable & java.io.Serializable> { 11 class Inner<Y> { } 12 } 13 14 class Box<Z> { 15 Box(Z z) { } 16 } 17 18 { 19 new Box<>(new Outer<>().new Inner<>()) { }; 20 } 21} 22