langtools/test/tools/javac/lambda/8074381/T8074381a.java
changeset 29553 716d47f5a45e
child 37636 6c6e6e25189d
equal deleted inserted replaced
29552:690d0becaf32 29553:716d47f5a45e
       
     1 /*
       
     2  * @test /nodynamiccopyright/
       
     3  * @bug 8074381
       
     4  * @summary java.lang.AssertionError during compiling
       
     5  * @compile/fail/ref=T8074381a.out -XDrawDiagnostics T8074381a.java
       
     6  */
       
     7 class T8074381a {
       
     8     interface Sup<X> {
       
     9         boolean m(X x);
       
    10     }
       
    11 
       
    12     interface Sub<X> extends Sup<String> {
       
    13         boolean m(String s);
       
    14     }
       
    15 
       
    16     void testRaw() {
       
    17         Sub s1 = c -> true;
       
    18         Sub s2 = Boolean::new;
       
    19         Sub s3 = new Sub() {
       
    20             @Override
       
    21             public boolean m(String o) { return true; }
       
    22         };
       
    23     }
       
    24 
       
    25     void testNonRaw() {
       
    26         Sub<Integer> s1 = c -> true;
       
    27         Sub<Integer> s2 = Boolean::new;
       
    28         Sub<Integer> s3 = new Sub<Integer>() {
       
    29             @Override
       
    30             public boolean m(String o) { return true; }
       
    31         };
       
    32     }
       
    33 }