e6b5cb5216
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
31 lines
921 B
Kotlin
Vendored
31 lines
921 B
Kotlin
Vendored
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument
|
|
// !CHECK_TYPE
|
|
// FILE: Fn.java
|
|
public interface Fn<T, R> {
|
|
R apply(T t);
|
|
}
|
|
|
|
// FILE: Fn2.java
|
|
public interface Fn2<T, R> extends Fn<T, R> {}
|
|
|
|
// FILE: 1.kt
|
|
interface K {
|
|
fun foo(f: Fn<String, Any>): String
|
|
fun foo(f: Fn<Any, Any>): Int
|
|
|
|
fun bas(f: Fn<Any, Any>): String
|
|
fun bas(f: Fn<Any, String>): Int
|
|
|
|
fun bar(f: Fn<String, Any>): String
|
|
fun bar(f: Fn2<String, Any>): Int
|
|
}
|
|
|
|
fun test(k: K) {
|
|
k.foo { it checkType { _<Any>() }; "" } checkType { _<Int>() }
|
|
|
|
k.bas { it checkType { _<Any?>() }; "" } checkType { _<Int>() }
|
|
|
|
// NI: TODO
|
|
k.<!OVERLOAD_RESOLUTION_AMBIGUITY!>bar<!> { <!UNRESOLVED_REFERENCE!>it<!> <!DEBUG_INFO_MISSING_UNRESOLVED!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><Any>() }; "" } <!DEBUG_INFO_MISSING_UNRESOLVED!>checkType<!> { <!UNRESOLVED_REFERENCE!>_<!><Int>() }
|
|
}
|