[PSI2IR] Propagate smart cast information for variable loads.
This gives us more precise type information and can enable backend optimizations. This was motivated by when expressions not compiled to table switches in the JVM_IR backend. Fixed KT-36845.
This commit is contained in:
Vendored
+1
-7
@@ -1,12 +1,6 @@
|
||||
fun test(x: Any?, y: Double): Boolean {
|
||||
return when {
|
||||
x is Int -> less(arg0 = { // BLOCK
|
||||
val tmp0_safe_receiver: Any? = x
|
||||
when {
|
||||
EQEQ(arg0 = tmp0_safe_receiver, arg1 = null) -> null
|
||||
else -> tmp0_safe_receiver /*as Int */.toDouble()
|
||||
}
|
||||
}, arg1 = y)
|
||||
x is Int -> less(arg0 = x /*as Int */.toDouble(), arg1 = y)
|
||||
else -> false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user