Files
kotlin-fork/compiler/testData/diagnostics/tests/operatorsOverloading/kt11300.kt
T
2019-09-20 17:56:06 +03:00

13 lines
398 B
Kotlin
Vendored

// !WITH_NEW_INFERENCE
class A {
operator fun get(x: Int): Int = x
fun set(<!UNUSED_PARAMETER!>x<!>: Int, <!UNUSED_PARAMETER!>y<!>: Int) {} // no `operator` modifier
}
fun main() {
val a = A()
<!OPERATOR_MODIFIER_REQUIRED!>a<!NI;NO_SET_METHOD!>[1]<!><!>++
<!OPERATOR_MODIFIER_REQUIRED!>a<!NI;NO_SET_METHOD!>[1]<!><!> += 3
<!OPERATOR_MODIFIER_REQUIRED!>a[1]<!> = a[1] + 3
}