// !LANGUAGE: +NewInference // !CHECK_TYPE // FILE: Fn.java public interface Fn { R apply(T t); } // FILE: Fn2.java public interface Fn2 extends Fn {} // FILE: J.java public interface J { String foo(Fn f, Object o); int foo(Fn f, String s); // (Any) -> Any <: (String) -> Any <=> String <: Any String bas(Fn f, Object o); int bas(Fn f, String s); // (Any) -> String <: (Any) -> Any <=> String <: Any String bar(Fn f); int bar(Fn2 f); // Fn2 seems more specific one even function type same } // FILE: 1.kt fun test(j: J) { j.foo({ it checkType { _() }; "" }, "") checkType { _() } j.bas({ it checkType { _() }; "" }, "") checkType { _() } // NI: TODO j.bar { it checkType { _() }; "" } checkType { _() } }