MostSpecific26.java revision 3199:3a6560c043d2
1/* 2 * @test /nodynamiccopyright/ 3 * @bug 8143852 4 * @summary Most specific inference constraints derived from intersection bound 5 * @compile/fail/ref=MostSpecific26.out -XDrawDiagnostics MostSpecific26.java 6 */ 7class MostSpecific26 { 8 interface F1<T> { <X extends Iterable<T> & Runnable> Object apply(T arg); } 9 interface F2 { <Y extends Iterable<Number> & Runnable> String 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 String foo(Object in) { return "a"; } 15 16 void test() { 17 m1(MostSpecific26::foo); 18 } 19 20}