[FIR] Insert fake source for FIR for array access temporaries
This commit is contained in:
committed by
Ilya Kirillov
parent
46feb00ee7
commit
fcabc60471
+8
@@ -0,0 +1,8 @@
|
||||
interface MyMap<K, V> {
|
||||
operator fun get(k: K): V
|
||||
operator fun set(k: K, v: V)
|
||||
}
|
||||
|
||||
fun test(m: MyMap<String, Int>) {
|
||||
<expr>m</expr>["a"] += 1
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
KT element: KtNameReferenceExpression
|
||||
FIR element: FirPropertyAccessExpressionImpl
|
||||
FIR source kind: KtRealSourceElementKind
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/m|
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
interface A {
|
||||
operator fun inc(): A
|
||||
}
|
||||
|
||||
interface MyMap<K, V> {
|
||||
operator fun get(k: K): V
|
||||
operator fun set(k: K, v: V): Unit
|
||||
}
|
||||
|
||||
fun test(m: MyMap<String, A>) {
|
||||
<expr>m["a"]++</expr>
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
KT element: KtPostfixExpression
|
||||
FIR element: FirFunctionCallImpl
|
||||
FIR source kind: DesugaredIncrementOrDecrement
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/<array>|.R|SubstitutionOverride</MyMap.set: R|kotlin/Unit|>|(R|<local>/<index_0>|, R|<local>/<unary>|.R|/A.inc|())
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
|
||||
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
interface A {
|
||||
operator fun inc(): A
|
||||
}
|
||||
|
||||
interface MyMap<K, V> {
|
||||
operator fun get(k: K): V
|
||||
operator fun set(k: K, v: V): Unit
|
||||
}
|
||||
|
||||
fun test(m: MyMap<String, A>) {
|
||||
<expr>m</expr>["a"]++
|
||||
}
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
KT element: KtNameReferenceExpression
|
||||
FIR element: FirPropertyAccessExpressionImpl
|
||||
FIR source kind: KtRealSourceElementKind
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/m|
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
interface A {
|
||||
operator fun inc(): A
|
||||
}
|
||||
|
||||
interface MyMap<K, V> {
|
||||
operator fun get(k: K): V
|
||||
operator fun set(k: K, v: V): Unit
|
||||
}
|
||||
|
||||
fun test(m: MyMap<String, A>) {
|
||||
<expr>m["a"]</expr>++
|
||||
}
|
||||
Vendored
+6
@@ -0,0 +1,6 @@
|
||||
KT element: KtArrayAccessExpression
|
||||
FIR element: FirResolvedNamedReferenceImpl
|
||||
FIR source kind: KtRealSourceElementKind
|
||||
|
||||
FIR element rendered:
|
||||
R|SubstitutionOverride</MyMap.set: R|kotlin/Unit|>|
|
||||
Reference in New Issue
Block a user