Files
kotlin-fork/compiler/testData/codegen/box/closures/capturedVarsOptimization/capturedInInlineOnlyIndexedCAO.kt
T
2019-11-19 11:00:09 +03:00

19 lines
361 B
Kotlin
Vendored

// IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME
class Host(var value: String) {
operator fun get(i: Int, j: Int, k: Int) = value
operator fun set(i: Int, j: Int, k: Int, newValue: String) {
value = newValue
}
}
fun box(): String {
var x = Host("")
run {
x[0, 0, 0] += "O"
x[0, 0, 0] += "K"
}
return x.value
}