Set correct IR origins for inc/dec operations
NB: in order to produce correct IR origins, the source element kinds for some FIR elements has been changed. As a side effect, mapping PSI to FIR slightly changed: namely, for `a[b]++`, `a[b]` used to be mapped on `set` call or callable reference, but now it is mapped on `get` call. ^KT-61891: Fixed ^KT-64387: Fixed
This commit is contained in:
committed by
Space Team
parent
8b1d87848d
commit
9aa8fb80e7
@@ -1,4 +1,6 @@
|
||||
// TARGET_BACKEND: JS_IR
|
||||
// KT-65195
|
||||
// IGNORE_BACKEND_K2: JS_IR
|
||||
|
||||
fun testArrayIncrementDecrement(d: dynamic) {
|
||||
val t1 = ++d["prefixIncr"]
|
||||
|
||||
+2
-2
@@ -31,7 +31,7 @@ FILE fqName:<root> fileName:/dynamicMemberIncrementDecrement.kt
|
||||
then: CONST Null type=kotlin.Nothing? value=null
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: BLOCK type=dynamic origin=null
|
||||
then: BLOCK type=dynamic origin=PREFIX_INCR
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_1 type:dynamic [val]
|
||||
GET_VAR 'val tmp_0: dynamic declared in <root>.testSafeMemberIncrementDecrement' type=dynamic origin=null
|
||||
DYN_OP operator=EQ type=kotlin.Unit
|
||||
@@ -54,7 +54,7 @@ FILE fqName:<root> fileName:/dynamicMemberIncrementDecrement.kt
|
||||
then: CONST Null type=kotlin.Nothing? value=null
|
||||
BRANCH
|
||||
if: CONST Boolean type=kotlin.Boolean value=true
|
||||
then: BLOCK type=dynamic origin=null
|
||||
then: BLOCK type=dynamic origin=PREFIX_DECR
|
||||
VAR IR_TEMPORARY_VARIABLE name:tmp_3 type:dynamic [val]
|
||||
GET_VAR 'val tmp_2: dynamic declared in <root>.testSafeMemberIncrementDecrement' type=dynamic origin=null
|
||||
DYN_OP operator=EQ type=kotlin.Unit
|
||||
|
||||
Reference in New Issue
Block a user