FIR: introduce FirExpressionWithSmartcastToNull

This new kind of expression encompasses the nullability of the original
expression after null check (or equivalent `is Nothing?` check).

Unlike FirExpressionWithSmartcast, this expression won't be materialized
during conversion to backend IR. Also, Nothing? is discarded when
computing the intersection of possible types from smartcast info.
In that way, Nothing? is not used during resolution, while such
smartcast info is stored in it (and the expression kind itself).
This commit is contained in:
Jinseong Jeon
2021-04-29 23:50:22 -07:00
committed by TeamCityServer
parent 8da183e4f4
commit 8e10b5fdec
36 changed files with 370 additions and 104 deletions
@@ -26,7 +26,7 @@ fun testSpilling(x: Any?) {
myAssert(x is String)
x.length
}
x.<!UNRESOLVED_REFERENCE!>length<!>
x<!UNSAFE_CALL!>.<!>length
}
fun testAssertInIf(x: Any?) {