FIR: don't emit SENSELESS_NULL_IN_WHEN when value is always null

This case (value is always null) contradicts the error message which says
"Expression under 'when' is never equal to null".
This commit is contained in:
pyos
2022-11-08 14:26:49 +01:00
committed by teamcity
parent fbb54f0300
commit e7b4927b6c
5 changed files with 10 additions and 9 deletions
@@ -3,7 +3,7 @@
// exhaustive
fun test1(n: Nothing) = when (n) { }
fun test2(n: Nothing?) = when (n) {
<!SENSELESS_NULL_IN_WHEN!>null<!> -> {}
<!SENSELESS_COMPARISON!>null<!> -> {}
}
// not exhaustive