Maurizio Cimadamore 04f289629a 8170410: inference: javac doesn't implement 18.2.5 correctly
Javac does not generate constraints of the kind 'throws alpha' as described in the spec

Reviewed-by: vromero, dlsmith
2016-12-05 19:00:56 +00:00

24 lines
517 B
Java

/*
* @test
* @bug 8170410
* @summary inference: javac doesn't implement 18.2.5 correctly
* @compile T8170410.java
*/
class T8170410 {
interface CheckedSupplier<T extends Throwable, R> {
R get() throws T;
}
static <T extends Throwable, R> CheckedSupplier<T, R> checked(CheckedSupplier<T, R> checkedSupplier) {
return checkedSupplier;
}
static void test() {
checked(() -> null).get();
checked(T8170410::m).get();
}
static String m() { return ""; }
}