Files
kotlin-fork/compiler/testData/diagnostics/tests/smartCasts/kt6819.fir.kt
T
Tianyu Geng 1679da45ab FIR checker: COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT
FIR simply ignores anything after the first comma if the when expression
doesn't have a subject. Hence, the checker has to rely on PSI structure
instead.
2021-08-12 18:42:26 +03:00

8 lines
245 B
Kotlin
Vendored

public fun test(o: String?): Boolean {
return when {
// Data flow info should propagate from o == null to o.length
o == null<!COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT!>,<!> o.length == 0 -> false
else -> true
}
}