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.
This commit is contained in:
Tianyu Geng
2021-07-19 19:27:11 -07:00
committed by Ivan Kochurkin
parent db12a96e54
commit 1679da45ab
16 changed files with 113 additions and 25 deletions
@@ -1,7 +1,7 @@
public fun test(o: String?): Boolean {
return when {
// Data flow info should propagate from o == null to o.length
o == null, o.length == 0 -> false
o == null<!COMMA_IN_WHEN_CONDITION_WITHOUT_ARGUMENT!>,<!> o.length == 0 -> false
else -> true
}
}
}