Files
kotlin-fork/js/js.translator/testData/box/operatorOverloading/postfixOnProperty.kt
T
Alexey Andreev 3b3fd0fa0d JS: fix DCE limits in test data to fit new kotlin.js size
The size has increased due to new implementation of KClass
2017-10-06 18:16:51 +03:00

23 lines
315 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1114
package foo
var a = MyInt()
class MyInt() {
var b = 0
operator fun inc(): MyInt {
b = b + 1;
return this;
}
}
fun box(): String {
val d = a++;
if (a.b != 1) return "fail1: ${a.b}"
if (d.b != 1) return "fail2: ${d.b}"
return "OK"
}