[FIR] Desugar increment/decrement in body resolve phase

The expression needs to be resolved first to determine if there is a
receiver that needs to be extracted to a temporary variable. Also, the
special case for prefix increment/decrement on local variable without
delegates requires resolution to check if the variable is local.

^KT-56771 Fixed
^KT-56659 Fixed
This commit is contained in:
Kirill Rakhman
2023-02-21 16:24:34 +01:00
committed by Space Team
parent 5ecf9cce25
commit 3b9724d20e
77 changed files with 1171 additions and 553 deletions
@@ -104,16 +104,17 @@ FILE fqName:<root> fileName:/breakContinueInLoopHeader.kt
WHILE label=Outer origin=WHILE_LOOP
condition: CONST Boolean type=kotlin.Boolean value=true
body: BLOCK type=kotlin.Unit origin=null
SET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Unit origin=PREFIX_INCR
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
TYPE_OP type=kotlin.Unit origin=IMPLICIT_COERCION_TO_UNIT typeOperand=kotlin.Unit
GET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
BLOCK type=kotlin.Int origin=null
SET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Unit origin=PREFIX_INCR
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
GET_VAR 'var i: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null
VAR name:j type:kotlin.Int [var]
CONST Int type=kotlin.Int value=0
BLOCK type=kotlin.Unit origin=null
DO_WHILE label=Inner origin=DO_WHILE_LOOP
body: COMPOSITE type=kotlin.Unit origin=DO_WHILE_LOOP
body: BLOCK type=kotlin.Int origin=null
SET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Unit origin=PREFIX_INCR
CALL 'public final fun inc (): kotlin.Int [operator] declared in kotlin.Int' type=kotlin.Int origin=null
$this: GET_VAR 'var j: kotlin.Int [var] declared in <root>.test5' type=kotlin.Int origin=null