[FIR2IR] Coerce to Unit for last statement in Unit-typed IrBlocks

^KT-59781 Fixed
This commit is contained in:
Sergej Jaskiewicz
2024-02-09 18:30:41 +01:00
committed by Space Team
parent eec10f3f2c
commit 80240198d2
2 changed files with 6 additions and 5 deletions
@@ -8,10 +8,11 @@ FILE fqName:<root> fileName:/listAssignmentInWhen.kt
BRANCH
if: GET_VAR 'condition: kotlin.Boolean declared in <root>.foo' type=kotlin.Boolean origin=null
then: BLOCK type=kotlin.Unit origin=null
CALL 'public abstract fun set (index: kotlin.Int, element: E of kotlin.collections.MutableList): E of kotlin.collections.MutableList declared in kotlin.collections.MutableList' type=kotlin.Any? origin=null
$this: GET_VAR 'list: kotlin.collections.MutableList<kotlin.Any?> declared in <root>.foo' type=kotlin.collections.MutableList<kotlin.Any?> origin=null
index: CONST Int type=kotlin.Int value=0
element: CONST String type=kotlin.String value="OK"
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
CALL 'public abstract fun set (index: kotlin.Int, element: E of kotlin.collections.MutableList): E of kotlin.collections.MutableList declared in kotlin.collections.MutableList' type=kotlin.Any? origin=null
$this: GET_VAR 'list: kotlin.collections.MutableList<kotlin.Any?> declared in <root>.foo' type=kotlin.collections.MutableList<kotlin.Any?> origin=null
index: CONST Int type=kotlin.Int value=0
element: CONST String type=kotlin.String value="OK"
BRANCH
if: CONST Boolean type=kotlin.Boolean value=true
then: GET_OBJECT 'CLASS IR_EXTERNAL_DECLARATION_STUB OBJECT name:Unit modality:FINAL visibility:public superTypes:[kotlin.Any]' type=kotlin.Unit