/* * @test /nodynamiccopyright/ * @bug 8016177 8016178 * @summary structural most specific and stuckness * @compile/fail/ref=T8016177a.out -XDrawDiagnostics T8016177a.java */ import java.util.List; class T8016177a { interface ToIntFunction { int m(X x); } interface Function { Y m(X x); } void m1(List s, Function f) { } void m1(List s, ToIntFunction f) { } List m2(List s, Function f) { return null; } List m2(List s, ToIntFunction f) { return null; } List m3(List s, Function f) { return null; } List m3(List s, ToIntFunction f) { return null; } List m4(List s, Function f) { return null; } List m4(List s, ToIntFunction f) { return null; } List m5(List s, Function f) { return null; } List m5(List s, ToIntFunction f) { return null; } List m6(List s, Function f) { return null; } List m6(List s, ToIntFunction f) { return null; } void test(List ss) { m1(ss, s->s.length()); //ambiguous m2(ss, s->s.length()); //ambiguous m3(ss, s->s.length()); //ambiguous m4(ss, s->s.length()); //ambiguous m5(ss, s->s.length()); //ambiguous m6(ss, s->s.length()); //ambiguous } }