Mon, 19 Jun 2017 14:51:25 -0700
Added tag jdk8u151-b02 for changeset 732e1bab2660
jlahoda@2606 | 1 | /** |
jlahoda@2606 | 2 | * @test |
jlahoda@2606 | 3 | * @bug 8062747 |
jlahoda@2606 | 4 | * @summary Avoiding an error for lambdas with thrown types inference inside an anonymous class. |
jlahoda@2606 | 5 | * @compile T8062747.java |
jlahoda@2606 | 6 | */ |
jlahoda@2606 | 7 | public class T8062747 { |
jlahoda@2606 | 8 | |
jlahoda@2606 | 9 | public interface Throwing<Y extends Exception> { |
jlahoda@2606 | 10 | void canThrow() throws Y; |
jlahoda@2606 | 11 | } |
jlahoda@2606 | 12 | |
jlahoda@2606 | 13 | public static <Y extends Exception> void wrap(Throwing<Y> action) { |
jlahoda@2606 | 14 | } |
jlahoda@2606 | 15 | |
jlahoda@2606 | 16 | public static void invoke(String a) { |
jlahoda@2606 | 17 | Runnable r = new Runnable() { |
jlahoda@2606 | 18 | @Override |
jlahoda@2606 | 19 | public void run() { |
jlahoda@2606 | 20 | wrap(() -> System.out.println(a)); |
jlahoda@2606 | 21 | } |
jlahoda@2606 | 22 | }; |
jlahoda@2606 | 23 | } |
jlahoda@2606 | 24 | } |