c2cf4aa2b5
If new inference is enabled only for IDE analysis, then this feature will be disabled to reduce difference between new and old inference, but if new inference is enabled in the compiler, then this feature will be enabled too to preserve behavior of new inference for compilation #KT-32175 Fixed #KT-32143 Fixed #KT-32123 Fixed #KT-32230 Fixed
27 lines
631 B
Kotlin
Vendored
27 lines
631 B
Kotlin
Vendored
// !LANGUAGE: +NewInference +SamConversionForKotlinFunctions +SamConversionPerArgument
|
|
// !CHECK_TYPE
|
|
// FILE: F.java
|
|
public interface F<S> {
|
|
void apply(S s);
|
|
}
|
|
|
|
// FILE: PR.java
|
|
public interface PR<X, Y> {}
|
|
|
|
// FILE: 1.kt
|
|
interface K<T> {
|
|
fun f_t(f1: F<T>, f2: F<T>)
|
|
fun <R> f_r(f1: F<R>, f2: F<R>)
|
|
fun <R> f_pr(f1: F<PR<T, R>>, f2: F<PR<T, R>>)
|
|
}
|
|
|
|
fun test(
|
|
k: K<String>,
|
|
f_string: F<String>,
|
|
f_int: F<Int>,
|
|
f_pr: F<PR<String, Int>>
|
|
) {
|
|
k.f_t(f_string) { it checkType { _<String>() } }
|
|
k.f_r(f_int) { it checkType { _<Int>() } }
|
|
k.f_pr(f_pr) { it checkType { _<PR<String, Int>>() } }
|
|
} |