Files
kotlin-fork/compiler/testData/diagnostics/tests/operatorsOverloading/kt45503_2.kt
T
2021-03-30 18:06:06 +03:00

16 lines
240 B
Kotlin
Vendored

// FIR_IDENTICAL
// WITH_RUNTIME
// SKIP_TXT
class A<T>(var x: T)
interface I
class C {
operator fun <T> get(k: A<T>): T = k.x
operator fun <T : I> set(k: A<T>, v: T) { k.x = v }
}
fun foo() {
C()[A(mutableListOf(1))] += 2
}