FIR: Report UNSAFE_CALL instead of SMARTCAST_IMPOSSIBLE when smartcast

to null.

Currently the error message shows the expression is impossible to
smartcast to the nullable type, which is nonsensical since it's already
that type.
This commit is contained in:
Mark Punzalan
2021-07-29 18:52:36 +00:00
committed by teamcityserver
parent 0627dbcb78
commit 504449f03e
4 changed files with 71 additions and 0 deletions
@@ -232,3 +232,11 @@ FILE: nullability.kt
}
}
public final fun test_14(q: R|Q|): R|kotlin/Unit| {
when () {
==(R|<local>/q|.R|/Q.data|, Null(null)) -> {
R|<local>/q|.R|/Q.data|.<Inapplicable(UNSAFE_CALL): /MyData.s>#
}
}
}