Resolve array access RHS always as the last argument of the call
Also do not attempt to match any of the arguments in the brackets with the last parameter of the 'set' method #KT-10633 Fixed
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
var count = 0
|
||||
|
||||
operator fun Int.get(s: Int): Int {
|
||||
count++
|
||||
return this + s
|
||||
}
|
||||
|
||||
operator fun Int.set(s: Int, x: String = "", z: Int) {
|
||||
}
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
1[2] = 1
|
||||
1.set(2, z = 1)
|
||||
1[2] += 1
|
||||
|
||||
1.set(2, <!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!><!NO_VALUE_FOR_PARAMETER!>)<!>
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
package
|
||||
|
||||
public var count: kotlin.Int
|
||||
public fun main(/*0*/ args: kotlin.Array<kotlin.String>): kotlin.Unit
|
||||
public operator fun kotlin.Int.get(/*0*/ s: kotlin.Int): kotlin.Int
|
||||
public operator fun kotlin.Int.set(/*0*/ s: kotlin.Int, /*1*/ x: kotlin.String = ..., /*2*/ z: kotlin.Int): kotlin.Unit
|
||||
Reference in New Issue
Block a user