langtools/test/tools/javac/lambda/MostSpecific32.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=MostSpecific32.out -XDrawDiagnostics MostSpecific32.java
 */
class MostSpecific32 {

    interface A<T> {}
    interface B<T> extends A<T> {}

    interface F1<S> { A<S> apply(); }
    interface F2<S> { B<S> apply(); }

    static void m1(F1<? extends Number> f1) {}
    static void m1(F2<? extends Number> f2) {}

    void test() {
        m1(() -> null); // B<CAP ext Number> </: A<Number>
    }

}