< prev index next >

test/langtools/tools/javac/generics/diamond/neg/Neg09d.java

Print this page


   1 /*
   2  * @test /nodynamiccopyright/
   3  * @bug 7020044 8062373
   4  *
   5  * @summary  Check that diamond is not allowed with anonymous inner class expressions at source < 9
   6  * @author Maurizio Cimadamore
   7  * @compile/fail/ref=Neg09d.out Neg09d.java -source 8 -XDrawDiagnostics
   8  *
   9  */
  10 
  11 class Neg09d {
  12 
  13     static class Nested<X> {}
  14 
  15     void testQualified() {
  16         Nested<?> m2 = new Neg09.Nested<>() {};
  17     }
  18 }
   1 /*
   2  * @test /nodynamiccopyright/
   3  * @bug 7020044 8062373
   4  *
   5  * @summary  Check that diamond is not allowed with anonymous inner class expressions at source < 9
   6  * @author Maurizio Cimadamore
   7  * @compile/fail/ref=Neg09d.out Neg09d.java -source 8 -XDrawDiagnostics -Xlint:-options
   8  *
   9  */
  10 
  11 class Neg09d {
  12 
  13     static class Nested<X> {}
  14 
  15     void testQualified() {
  16         Nested<?> m2 = new Neg09.Nested<>() {};
  17     }
  18 }
< prev index next >