langtools/test/tools/javac/generics/diamond/neg/Neg04.java
changeset 5321 c8efe769cb3b
child 5327 cdc146f667c7
equal deleted inserted replaced
5320:e2aaa958b02d 5321:c8efe769cb3b
       
     1 /*
       
     2  * @test /nodynamiccopyright/
       
     3  * @bug 6939620
       
     4  *
       
     5  * @summary  Switch to 'complex' diamond inference scheme
       
     6  * @author mcimadamore
       
     7  * @compile/fail/ref=Neg04.out Neg04.java -XDrawDiagnostics
       
     8  *
       
     9  */
       
    10 
       
    11 class Neg04 {
       
    12 
       
    13     void test() {
       
    14         class Foo<V extends Number> {
       
    15             Foo(V x) {}
       
    16             <Z> Foo(V x, Z z) {}
       
    17         }
       
    18         Foo<String> n1 = new Foo<>("");
       
    19         Foo<? extends String> n2 = new Foo<>("");
       
    20         Foo<?> n3 = new Foo<>("");
       
    21         Foo<? super String> n4 = new Foo<>("");
       
    22 
       
    23         Foo<String> n5 = new Foo<>(""){};
       
    24         Foo<? extends String> n6 = new Foo<>(""){};
       
    25         Foo<?> n7 = new Foo<>(""){};
       
    26         Foo<? super String> n8 = new Foo<>(""){};
       
    27 
       
    28         Foo<String> n9 = new Foo<>("", "");
       
    29         Foo<? extends String> n10 = new Foo<>("", "");
       
    30         Foo<?> n11 = new Foo<>("", "");
       
    31         Foo<? super String> n12 = new Foo<>("", "");
       
    32 
       
    33         Foo<String> n13 = new Foo<>("", ""){};
       
    34         Foo<? extends String> n14 = new Foo<>("", ""){};
       
    35         Foo<?> n15 = new Foo<>("", ""){};
       
    36         Foo<? super String> n16 = new Foo<>("", ""){};
       
    37     }
       
    38 }