langtools/test/tools/javac/generics/diamond/7030150/Neg03.java
changeset 9610 ac6200e8bf05
parent 9591 fc4fca89dfad
parent 9609 c256c93c5f41
child 9613 4fc57aa6bbab
equal deleted inserted replaced
9591:fc4fca89dfad 9610:ac6200e8bf05
     1 /*
       
     2  * @test /nodynamiccopyright/
       
     3  * @bug 7030150
       
     4  * @summary Type inference for generic instance creation failed for formal type parameter
       
     5  *          check that explicit type-argument that does not conform to bound is rejected
       
     6  * @compile/fail/ref=Neg03.out -XDrawDiagnostics Neg03.java
       
     7  */
       
     8 
       
     9 class Neg03 {
       
    10 
       
    11     static class Foo<X> {
       
    12         <T extends Integer> Foo(T t) {}
       
    13     }
       
    14 
       
    15     Foo<Integer> fi1 = new <String> Foo<>(1);
       
    16     Foo<Integer> fi2 = new <String> Foo<Integer>(1);
       
    17 }