[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:
committed by
Space Team
parent
5ecf9cce25
commit
3b9724d20e
@@ -543,7 +543,7 @@ FILE fqName:<root> fileName:/ArrayMap.kt
|
||||
BLOCK_BODY
|
||||
BLOCK type=kotlin.Unit origin=null
|
||||
DO_WHILE label=null origin=DO_WHILE_LOOP
|
||||
body: COMPOSITE type=kotlin.Unit origin=DO_WHILE_LOOP
|
||||
body: BLOCK type=kotlin.Int origin=POSTFIX_INCR
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:kotlin.Int [val]
|
||||
CALL 'private final fun <get-index> (): kotlin.Int declared in <root>.ArrayMapImpl.iterator.<no name provided>' type=kotlin.Int origin=GET_PROPERTY
|
||||
$this: GET_VAR '<this>: <root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> declared in <root>.ArrayMapImpl.iterator.<no name provided>.computeNext' type=<root>.ArrayMapImpl.iterator.<no name provided><T of <root>.ArrayMapImpl> origin=null
|
||||
|
||||
@@ -224,11 +224,11 @@ internal class ArrayMapImpl<T : Any> : ArrayMap<T> {
|
||||
|
||||
protected override fun computeNext() {
|
||||
{ // BLOCK
|
||||
do// COMPOSITE {
|
||||
val <unary>: Int = <this>.<get-index>()
|
||||
<this>.<set-index>(<set-?> = <unary>.inc())
|
||||
<unary>
|
||||
// } while (when {
|
||||
do{ // BLOCK
|
||||
val <unary>: Int = <this>.<get-index>()
|
||||
<this>.<set-index>(<set-?> = <unary>.inc())
|
||||
<unary>
|
||||
} while (when {
|
||||
less(arg0 = <this>.<get-index>(), arg1 = <this>.<get-data>().<get-size>()) -> EQEQ(arg0 = <this>.<get-data>().get(index = <this>.<get-index>()), arg1 = null)
|
||||
else -> false
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user