checkLValue for array indexing expression should resolve set method #KT-7218 Fixed
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
fun getArray(): Array<Int> = throw Exception()
|
||||
fun getList(): MutableList<Int> = throw Exception()
|
||||
fun fn() {
|
||||
getArray()[1] = 2
|
||||
getList()[1] = 2
|
||||
getArray()[1]++
|
||||
getList()[1]++
|
||||
getArray()[1] += 2
|
||||
getList()[1] += 2
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package
|
||||
|
||||
internal fun fn(): kotlin.Unit
|
||||
internal fun getArray(): kotlin.Array<kotlin.Int>
|
||||
internal fun getList(): kotlin.MutableList<kotlin.Int>
|
||||
@@ -127,12 +127,12 @@ class Test() {
|
||||
a[4]++
|
||||
a[6] += 43
|
||||
|
||||
<!VARIABLE_EXPECTED!>ab.getArray()<!>[54] = 23
|
||||
<!VARIABLE_EXPECTED!>ab.getArray()<!>[54]++
|
||||
ab.getArray()[54] = 23
|
||||
ab.getArray()[54]++
|
||||
|
||||
(@f a)[3] = 4
|
||||
(a : Array<Int>)[4]++
|
||||
(<!VARIABLE_EXPECTED!>ab.getArray()<!> : Array<Int>)[54] += 43
|
||||
(ab.getArray() : Array<Int>)[54] += 43
|
||||
|
||||
this<!NO_SET_METHOD!><!UNRESOLVED_REFERENCE!>[<!>54<!UNRESOLVED_REFERENCE!>]<!><!> = 34
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user