FIR LL API: resolve PSI elements to more specific FIR element
Compound access and implicit delegated constructor are mapped to FIR elements that are way too broad.
This commit is contained in:
committed by
Ilya Kirillov
parent
e8f1af6140
commit
bc95733818
+6
@@ -0,0 +1,6 @@
|
||||
interface A {
|
||||
operator fun plusAssign(i: Int)
|
||||
}
|
||||
fun test(l: A) {
|
||||
<expr>l += 1</expr>
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
KT element: KtBinaryExpression
|
||||
FIR element: FirFunctionCallImpl
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/l|.R|/A.plusAssign|(Int(1))
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
interface A {
|
||||
operator fun plusAssign(i: Int)
|
||||
}
|
||||
fun test(l: A) {
|
||||
<expr>l</expr> += 1
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
KT element: KtNameReferenceExpression
|
||||
FIR element: FirPropertyAccessExpressionImpl
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/l|
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
fun test() {
|
||||
var i = 1
|
||||
<expr>i += 1</expr>
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
KT element: KtBinaryExpression
|
||||
FIR element: FirVariableAssignmentImpl
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/i| = R|<local>/i|.R|kotlin/Int.plus|(Int(1))
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
fun test() {
|
||||
var i = 1
|
||||
<expr>i</expr> += 1
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
KT element: KtNameReferenceExpression
|
||||
FIR element: FirResolvedNamedReferenceImpl
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/i|
|
||||
Vendored
+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["a"] += 1</expr>
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
KT element: KtBinaryExpression
|
||||
FIR element: FirFunctionCallImpl
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/<<array>>|.R|SubstitutionOverride</MyMap.set: R|kotlin/Unit|>|(R|<local>/<<index_0>>|, R|<local>/<<array>>|.R|SubstitutionOverride</MyMap.get: R|kotlin/Int|>|(R|<local>/<<index_0>>|).R|kotlin/Int.plus|(Int(1)))
|
||||
+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["a"]</expr> += 1
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
KT element: KtArrayAccessExpression
|
||||
FIR element: FirFunctionCallImpl
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/<<array>>|.R|SubstitutionOverride</MyMap.get: R|kotlin/Int|>|(R|<local>/<<index_0>>|)
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
interface A {
|
||||
operator fun plusAssign(i: Int)
|
||||
}
|
||||
|
||||
interface MyMap<K, V> {
|
||||
operator fun get(k: K): V
|
||||
}
|
||||
|
||||
fun test(m: MyMap<String, A>) {
|
||||
<expr>m["a"] += 1</expr>
|
||||
}
|
||||
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
KT element: KtBinaryExpression
|
||||
FIR element: FirFunctionCallImpl
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/m|.R|SubstitutionOverride</MyMap.get: R|A|>|(String(a)).R|/A.plusAssign|(Int(1))
|
||||
Vendored
+11
@@ -0,0 +1,11 @@
|
||||
interface A {
|
||||
operator fun plusAssign(i: Int)
|
||||
}
|
||||
|
||||
interface MyMap<K, V> {
|
||||
operator fun get(k: K): V
|
||||
}
|
||||
|
||||
fun test(m: MyMap<String, A>) {
|
||||
<expr>m["a"]</expr> += 1
|
||||
}
|
||||
analysis/low-level-api-fir/testdata/getOrBuildFir/calls/compoundAssignWithArrayGetConvention_lhs.txt
Vendored
+5
@@ -0,0 +1,5 @@
|
||||
KT element: KtArrayAccessExpression
|
||||
FIR element: FirFunctionCallImpl
|
||||
|
||||
FIR element rendered:
|
||||
R|<local>/m|.R|SubstitutionOverride</MyMap.get: R|A|>|(String(a))
|
||||
Reference in New Issue
Block a user