Files
kotlin-fork/compiler/testData/ir/irText/expressions/tryCatchWithImplicitCast.fir.txt
T
Mads Ager e8a640851a 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.
2020-01-31 09:31:52 +01:00

18 lines
1.2 KiB
Plaintext
Vendored

FILE fqName:<root> fileName:/tryCatchWithImplicitCast.kt
FUN name:testImplicitCast visibility:public modality:FINAL <> (a:kotlin.Any) returnType:kotlin.Unit
VALUE_PARAMETER name:a index:0 type:kotlin.Any
BLOCK_BODY
WHEN type=kotlin.Unit origin=IF
BRANCH
if: TYPE_OP type=kotlin.Boolean origin=NOT_INSTANCEOF typeOperand=kotlin.String
GET_VAR 'a: kotlin.Any declared in <root>.testImplicitCast' type=kotlin.Any origin=null
then: RETURN type=kotlin.Nothing from='public final fun testImplicitCast (a: kotlin.Any): kotlin.Unit declared in <root>'
GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit
VAR name:t type:kotlin.String [val]
TRY type=kotlin.String
try: TYPE_OP type=kotlin.String origin=IMPLICIT_CAST typeOperand=kotlin.String
GET_VAR 'a: kotlin.Any declared in <root>.testImplicitCast' type=kotlin.Any origin=null
CATCH parameter=val e: kotlin.Throwable [val] declared in <root>.testImplicitCast
VAR name:e type:kotlin.Throwable [val]
CONST String type=kotlin.String value=""