Files
kotlin-fork/compiler/testData/codegen/box/increment/kt36956.kt
T
Dmitry Petrov 2010d8d2b9 KT-36956 fix back-end part in JVM and JVM_IR
PSI2IR: deparenthesize LHS expression when generating assignment
receiver.

FE: record 'set' operator call for code generation.
2020-02-28 23:04:42 +03:00

11 lines
211 B
Kotlin
Vendored

class Cell(var x: Int) {
operator fun get(i: Int) = x
operator fun set(i: Int, v: Int) { x = v }
}
fun box(): String {
val c = Cell(0)
(c[0])++
if (c[0] != 1) return "Fail"
return "OK"
}