Files
kotlin-fork/compiler/testData/diagnostics/tests/operatorsOverloading/kt11300.fir.kt
T
Denis.Zharkov 2ecba6ac39 Remove WITH_NEW_INFERENCE directive from all tests
This directive anyway does not make test run twice with OI, and with NI
It only once run the test with specific settings (// LANGUAGE)
and ignores irrelevant (OI or NI tags)
2021-05-25 13:28:26 +03:00

13 lines
278 B
Kotlin
Vendored

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