1/*
2 * @test /nodynamiccopyright/
3 * @bug 8143852
4 * @summary Most specific failure if ivar can be bounded by functional interface method tparam
5 * @compile/fail/ref=MostSpecific25.out -XDrawDiagnostics MostSpecific25.java
6 */
7class MostSpecific25 {
8    interface F1<T> { <X> T apply(Integer arg); }
9    interface F2 { <Y> Class<? super Y> apply(Integer arg); }
10
11    static <T> T m1(F1<T> f) { return null; }
12    static Object m1(F2 f) { return null; }
13
14    static Class<Object> foo(Object in) { return Object.class; }
15
16    void test() {
17        m1(MostSpecific25::foo);
18    }
19
20}