langtools/test/tools/javac/lambda/MostSpecific30.java
author dlsmith
Fri, 10 Jun 2016 15:08:00 -0600
changeset 38913 5b15a5ed3b0d
permissions -rw-r--r--
8144767: Fix handling of capture variables in most-specific test Reviewed-by: vromero

/*
 * @test /nodynamiccopyright/
 * @bug 8144767
 * @summary Correct most-specific test when wildcards appear in functional interface type
 * @compile/fail/ref=MostSpecific30.out -XDrawDiagnostics MostSpecific30.java
 */
class MostSpecific30 {

    interface Pred<T> { boolean test(T arg); }
    interface Fun<T,R> { R apply(T arg); }

    static void m1(Pred<? extends Integer> f) {}
    static void m1(Fun<Integer, Boolean> f) {}

    void test() {
        m1((Integer n) -> true);
    }

}