[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:
@@ -19,9 +19,9 @@ fun test(x: I1) {
|
||||
x !is I2 -> return Unit
|
||||
}
|
||||
// COMPOSITE {
|
||||
val tmp0_container: I1 = x
|
||||
val c1: Int = tmp0_container.component1()
|
||||
val c2: String = tmp0_container /*as I2 */.component2()
|
||||
val tmp0_container: I2 = x /*as I2 */
|
||||
val c1: Int = tmp0_container /*as I1 */.component1()
|
||||
val c2: String = tmp0_container.component2()
|
||||
// }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user