langtools/test/tools/javac/generics/inference/8170410/T8170410.java
author mcimadamore
Mon, 05 Dec 2016 19:00:56 +0000
changeset 42416 1cfad0990b99
permissions -rw-r--r--
8170410: inference: javac doesn't implement 18.2.5 correctly Summary: javac does not generate constraints of the kind 'throws alpha' as described in the spec Reviewed-by: vromero, dlsmith

/*
 * @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 ""; }
}