MostSpecific28.java revision 3199:3a6560c043d2
1/*
2 * @test /nodynamiccopyright/
3 * @bug 8143852
4 * @summary Test that functional interface method parameter types are equal, even for an explicit lambda
5 * @compile/fail/ref=MostSpecific28.out -XDrawDiagnostics MostSpecific28.java
6 */
7class MostSpecific28 {
8
9    interface Pred<T> { boolean test(T arg); }
10    interface Fun<T,R> { R apply(T arg); }
11
12    static void m1(Pred<? super Integer> f) {}
13    static void m1(Fun<Number, Boolean> f) {}
14
15    static String foo(Object in) { return "a"; }
16
17    void test() {
18        m1((Number n) -> true);
19    }
20
21}
22