Files
kotlin-fork/compiler/testData/diagnostics/tests/dataFlowInfoTraversal/ExclExcl.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

24 lines
380 B
Kotlin
Vendored

fun bar(x: Int) = x + 1
fun f1(x: Int?) {
<!INAPPLICABLE_CANDIDATE!>bar<!>(x)
if (x != null) bar(x!!)
if (x == null) bar(x!!)
}
fun f2(x: Int?) {
if (x != null) else x!!
}
fun f3(x: Int?) {
if (x != null) bar(x!!) else x!!
}
fun f4(x: Int?) {
if (x == null) x!! else bar(x!!)
}
fun f5(x: Int?) {
if (x == null) else bar(x!!)
}