FIR: Change the Fir2Ir handling of smart casts.
Generate the expression with the original type and then insert an implicit conversion. That matches the behavior of psi2ir better and therefore avoids breaking backend assumptions. In particular, IrGetValue expects the type of the underlying symbol and the type of the IrGetValue to be the same.
This commit is contained in:
@@ -23,4 +23,5 @@ FILE fqName:<root> fileName:/castFromAny.kt
|
||||
GET_VAR 'a: kotlin.Any? declared in <root>.test' type=kotlin.Any? origin=null
|
||||
CALL 'public abstract fun invoke (): kotlin.Unit declared in <root>.KRunnable' type=kotlin.Unit origin=null
|
||||
$this: CALL 'public final fun KRunnable (block: kotlin.Function0<kotlin.Unit>): <root>.KRunnable declared in <root>' type=<root>.KRunnable origin=null
|
||||
block: GET_VAR 'a: kotlin.Any? declared in <root>.test' type=kotlin.Function0<kotlin.Unit> origin=null
|
||||
block: TYPE_OP type=kotlin.Function0<kotlin.Unit> origin=IMPLICIT_CAST typeOperand=kotlin.Function0<kotlin.Unit>
|
||||
GET_VAR 'a: kotlin.Any? declared in <root>.test' type=kotlin.Any? origin=null
|
||||
|
||||
Reference in New Issue
Block a user