Files
kotlin-fork/compiler/testData/diagnostics/tests/generics/nullability/functionalBound.fir.kt
T
simon.ogorodnik 34e6649d31 [FIR] Harden check of argument type properly
Before this commit, nullable argument could match not null parameter.
Now we require also correct nullability that breaks some cases
2020-02-03 16:45:18 +03:00

14 lines
255 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
fun <E : String?, T : ((CharSequence) -> Unit)?> foo(x: E, y: T) {
if (x != null) {
y(x)
}
if (y != null) {
<!INAPPLICABLE_CANDIDATE!>y<!>(x)
}
if (x != null && y != null) {
y(x)
}
}