checked exception constraints: ensure ground type (IDEA-173200)

This commit is contained in:
Anna Kozlova
2017-05-22 11:20:51 +03:00
parent 8ae9ee00bb
commit 011b8e4e10
3 changed files with 21 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.function.Function;
class Main {
public static void main(String[] args) {
runTest(Main::test, UncheckedIOException:: new);
}
private static void test() throws IOException {}
private static <E extends Throwable> void runTest(A<? extends E> a, Function<E, ?> b) { }
@FunctionalInterface
public interface A<E extends Throwable> {
void foo() throws E;
}
}