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:
committed by
TeamCityServer
parent
8da183e4f4
commit
8e10b5fdec
+1
-1
@@ -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?) {
|
||||
|
||||
Reference in New Issue
Block a user