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
+6
-10
@@ -196,11 +196,9 @@ internal class ArrayMapImpl<T : Any> : ArrayMap<T> {
|
||||
<this>.ensureCapacity(index = index)
|
||||
when {
|
||||
EQEQ(arg0 = <this>.<get-data>().get(index = index), arg1 = null) -> { // BLOCK
|
||||
{ // BLOCK
|
||||
val tmp_0: Int = <this>.<get-size>()
|
||||
<this>.<set-size>(<set-?> = tmp_0.inc())
|
||||
tmp_0
|
||||
}
|
||||
val tmp_0: Int = <this>.<get-size>()
|
||||
<this>.<set-size>(<set-?> = tmp_0.inc())
|
||||
tmp_0
|
||||
} /*~> Unit */
|
||||
}
|
||||
<this>.<get-data>().set(index = index, value = value)
|
||||
@@ -260,11 +258,9 @@ internal class ArrayMapImpl<T : Any> : ArrayMap<T> {
|
||||
fun remove(index: Int) {
|
||||
when {
|
||||
EQEQ(arg0 = <this>.<get-data>().get(index = index), arg1 = null).not() -> { // BLOCK
|
||||
{ // BLOCK
|
||||
val tmp_2: Int = <this>.<get-size>()
|
||||
<this>.<set-size>(<set-?> = tmp_2.dec())
|
||||
tmp_2
|
||||
}
|
||||
val tmp_2: Int = <this>.<get-size>()
|
||||
<this>.<set-size>(<set-?> = tmp_2.dec())
|
||||
tmp_2
|
||||
} /*~> Unit */
|
||||
}
|
||||
<this>.<get-data>().set(index = index, value = null)
|
||||
|
||||
Reference in New Issue
Block a user