[FIR2IR] Add Unit coercion for non-last expressions in try/catch blocks

^KT-61088 Fixed
This commit is contained in:
Sergej Jaskiewicz
2024-02-06 18:21:19 +01:00
committed by Space Team
parent 3d66511ca7
commit 88b80e0ed2
6 changed files with 27 additions and 3 deletions
@@ -18,13 +18,19 @@ FILE fqName:<root> fileName:/tryCatch.kt
TRY type=kotlin.Int
try: BLOCK type=kotlin.Int origin=null
CALL 'public final fun println (): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CONST Int type=kotlin.Int value=100
CONST Int type=kotlin.Int value=42
CATCH parameter=val e: kotlin.Throwable declared in <root>.test2
VAR CATCH_PARAMETER name:e type:kotlin.Throwable [val]
BLOCK type=kotlin.Int origin=null
CALL 'public final fun println (): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CONST Int type=kotlin.Int value=101
CONST Int type=kotlin.Int value=24
finally: BLOCK type=kotlin.Unit origin=null
CALL 'public final fun println (): kotlin.Unit declared in <root>' type=kotlin.Unit origin=null
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CONST Int type=kotlin.Int value=102
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CONST Int type=kotlin.Int value=555