langtools/test/tools/javac/generics/diamond/neg/Neg04.java
changeset 29776 984a79b71cfe
parent 8635 383a416a2bdf
equal deleted inserted replaced
29775:dc7df633fea1 29776:984a79b71cfe
     1 /*
     1 /*
     2  * @test /nodynamiccopyright/
     2  * @test /nodynamiccopyright/
     3  * @bug 6939620 7020044
     3  * @bug 6939620 7020044 8062373
     4  *
     4  *
     5  * @summary  Check that diamond fails when inference violates declared bounds
     5  * @summary  Check that diamond fails when inference violates declared bounds
     6  *           (test with local class, qualified/simple type expressions)
     6  *           (test with local class, qualified/simple type expressions)
     7  * @author mcimadamore
     7  * @author mcimadamore
     8  * @compile/fail/ref=Neg04.out Neg04.java -XDrawDiagnostics
     8  * @compile/fail/ref=Neg04.out Neg04.java -XDrawDiagnostics
    23 
    23 
    24         Foo<String> n5 = new Foo<>("", "");
    24         Foo<String> n5 = new Foo<>("", "");
    25         Foo<? extends String> n6 = new Foo<>("", "");
    25         Foo<? extends String> n6 = new Foo<>("", "");
    26         Foo<?> n7 = new Foo<>("", "");
    26         Foo<?> n7 = new Foo<>("", "");
    27         Foo<? super String> n8 = new Foo<>("", "");
    27         Foo<? super String> n8 = new Foo<>("", "");
       
    28 
       
    29         Foo<String> n9 = new Foo<>(""){};
       
    30         Foo<? extends String> n10 = new Foo<>(""){};
       
    31         Foo<?> n11 = new Foo<>(""){};
       
    32         Foo<? super String> n12 = new Foo<>(""){};
       
    33 
       
    34         Foo<String> n13 = new Foo<>("", ""){};
       
    35         Foo<? extends String> n14 = new Foo<>("", ""){};
       
    36         Foo<?> n15 = new Foo<>("", ""){};
       
    37         Foo<? super String> n16 = new Foo<>("", ""){};
    28     }
    38     }
    29 }
    39 }