Files
kotlin-fork/compiler/testData/diagnostics/tests/checkArguments/arrayAccessSetTooManyArgs.fir.kt
T
Mark Punzalan 34e6459014 FIR: Ensure that the array set argument (on RHS of =) is always mapped
to the last parameter of the set operator function, even if there are
missing or too many index arguments.
2021-08-31 14:52:28 +03:00

11 lines
203 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_PARAMETER
class A {
operator fun get(x: Int) {}
operator fun set(x: String, value: Int) {}
fun d(x: Int) {
this["", <!TOO_MANY_ARGUMENTS!>1<!>] = 1
}
}