Files
kotlin-fork/compiler/testData/diagnostics/tests/regressions/kt10633.kt
T
Alexander Udalov 8fe964f269 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
2016-01-21 00:36:35 +03:00

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!>)<!>
}