test/tools/javac/flow/T8062747.java

Mon, 04 Jul 2016 13:06:03 -0700

author
asaha
date
Mon, 04 Jul 2016 13:06:03 -0700
changeset 3255
b4bd1c5fbbe3
parent 2606
f7f3f96999ba
permissions
-rw-r--r--

Added tag jdk8u111-b03 for changeset 386c8bc6dd3e

     1 /**
     2  * @test
     3  * @bug 8062747
     4  * @summary Avoiding an error for lambdas with thrown types inference inside an anonymous class.
     5  * @compile T8062747.java
     6  */
     7 public class T8062747 {
     9     public interface Throwing<Y extends Exception> {
    10         void canThrow() throws Y;
    11     }
    13     public static <Y extends Exception> void wrap(Throwing<Y> action) {
    14     }
    16     public static void invoke(String a) {
    17         Runnable r = new Runnable() {
    18             @Override
    19             public void run() {
    20                 wrap(() -> System.out.println(a));
    21             }
    22         };
    23     }
    24 }

mercurial