Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/complexComparison.fir.kt
T
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00

23 lines
650 B
Kotlin
Vendored

fun foo(x: String?, y: String?, z: String?, w: String?) {
if (x != null && y != null && (x == z || y == z))
z.length
else
z<!UNSAFE_CALL!>.<!>length
if (x != null || y != null || (x != z && y != z))
z<!UNSAFE_CALL!>.<!>length
else
z<!UNSAFE_CALL!>.<!>length
if (x == null || y == null || (x != z && y != z))
z<!UNSAFE_CALL!>.<!>length
else
z.length
if (x != null && y == x && z == y && w == z)
w.length
else
w<!UNSAFE_CALL!>.<!>length
if ((x != null && y == x) || (z != null && y == z))
y.length
else
y<!UNSAFE_CALL!>.<!>length
}