8fe964f269
Also do not attempt to match any of the arguments in the brackets with the last parameter of the 'set' method #KT-10633 Fixed
20 lines
345 B
Kotlin
Vendored
20 lines
345 B
Kotlin
Vendored
// !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!>)<!>
|
|
}
|