langtools/test/tools/javac/lambda/8066974/T8066974.java
changeset 29776 984a79b71cfe
parent 28148 6415a95b07fd
equal deleted inserted replaced
29775:dc7df633fea1 29776:984a79b71cfe
     1 /*
     1 /*
     2  * @test /nodynamiccopyright/
     2  * @test /nodynamiccopyright/
     3  * @bug 8066974
     3  * @bug 8066974 8062373
     4  * @summary Compiler doesn't infer method's generic type information in lambda body
     4  * @summary Compiler doesn't infer method's generic type information in lambda body
     5  * @compile/fail/ref=T8066974.out -XDrawDiagnostics T8066974.java
     5  * @compile/fail/ref=T8066974.out -XDrawDiagnostics T8066974.java
     6  */
     6  */
     7 class T8066974 {
     7 class T8066974 {
     8     static class Throwing<E extends Throwable> { }
     8     static class Throwing<E extends Throwable> { }
    32 
    32 
    33     void testRuntime(RuntimeThrowing rt) {
    33     void testRuntime(RuntimeThrowing rt) {
    34         map(p->p.m(rt));
    34         map(p->p.m(rt));
    35         map(mapper(rt));
    35         map(mapper(rt));
    36         map(new ThrowingMapper<>(rt));
    36         map(new ThrowingMapper<>(rt));
       
    37         map(new ThrowingMapper<>(rt) {});
    37     }
    38     }
    38 
    39 
    39     void testChecked(CheckedThrowing ct) {
    40     void testChecked(CheckedThrowing ct) {
    40         map(p->p.m(ct));
    41         map(p->p.m(ct));
    41         map(mapper(ct));
    42         map(mapper(ct));
    42         map(new ThrowingMapper<>(ct));
    43         map(new ThrowingMapper<>(ct));
       
    44         map(new ThrowingMapper<>(ct) {});
    43     }
    45     }
    44 }
    46 }