[AA] resolve array access expression to corresponding set operator
k1 would suggest `get` as well but with current fir structure with fake desugaring get is moved to the separate fake psi which doesn't exist thus the problem is ignored for now ^ KTIJ-24025
This commit is contained in:
+3
@@ -0,0 +1,3 @@
|
||||
Resolved to:
|
||||
0: (in test.B) operator fun get(i: kotlin.Int): test.B
|
||||
1: (in test.B) operator fun set(i: kotlin.Int, a: test.B)
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
|
||||
class B(val n: Int) {
|
||||
operator fun set(i: Int, a: B) {}
|
||||
operator fun get(i: Int) : B { return B(i) }
|
||||
operator fun inc() : B {return B(n + 1)}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
var a = B(1)
|
||||
a<caret>[2]++
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
0: (in test.B) operator fun set(i: kotlin.Int, a: test.B)
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// UNRESOLVED_REFERENCE
|
||||
package test
|
||||
|
||||
class B(val n: Int) {
|
||||
operator fun inc() : B {return B(n + 1)}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
var a = B(1)
|
||||
a<caret>[2]++
|
||||
}
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
Resolved to:
|
||||
0: (in test.B) operator fun set(i: kotlin.Int, a: test.B)
|
||||
Reference in New Issue
Block a user