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:
+2
-1
@@ -133,5 +133,6 @@ FILE fqName:<root> fileName:/caoWithAdaptationForSam.kt
|
||||
TYPE_OP type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=CAST typeOperand=kotlin.Function1<kotlin.Int, kotlin.Unit>
|
||||
GET_VAR 'a: kotlin.Any declared in <root>.test6' type=kotlin.Any origin=null
|
||||
TYPE_OP type=<root>.IFoo origin=CAST typeOperand=<root>.IFoo
|
||||
GET_VAR 'a: kotlin.Any declared in <root>.test6' type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=null
|
||||
TYPE_OP type=kotlin.Function1<kotlin.Int, kotlin.Unit> origin=IMPLICIT_CAST typeOperand=kotlin.Function1<kotlin.Int, kotlin.Unit>
|
||||
GET_VAR 'a: kotlin.Any declared in <root>.test6' type=kotlin.Any origin=null
|
||||
ERROR_CALL 'FirArraySetCall (resolve isn't supported yet)' type=kotlin.Unit
|
||||
|
||||
Reference in New Issue
Block a user