/* * @test /nodynamiccopyright/ * @bug 8016177 8016178 * @summary structural most specific and stuckness * @compile/fail/ref=T8016177b.out -XDrawDiagnostics T8016177b.java */ class T8016177b { interface ToIntFunction { int m(X x); } interface Function { Y m(X x); } Function id(Function arg) { return null; } Function id2(Function arg) { return null; } ToIntFunction id2(ToIntFunction arg) { return null; } X f(Y arg, Function f) { return null; } X f2(Y arg, Function f) { return null; } X f2(Y arg, ToIntFunction f) { return null; } T g(T arg) { return null; } void test() { g(f("hi", id(x->1))); //ok g(f("hi", id2(x->1))); //ambiguous g(f2("hi", id(x->1))); //ok } }