Files
kotlin-fork/js/js.translator/testData/box/operatorOverloading/unaryOnIntPropertyAsStatement.kt
T
2016-09-29 12:00:41 +03:00

15 lines
225 B
Kotlin
Vendored

package foo
class MyInt(i: Int) {
var b = i
operator fun inc(): MyInt {
b++;
return this;
}
}
fun box(): String {
var t = MyInt(0)
t++;
return if (t.b == 1) "OK" else "fail: ${t.b}"
}