Files
kotlin-fork/js/js.translator/testData/box/inheritance/abstractVarOverride.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

26 lines
400 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1119
package foo
open abstract class A() {
abstract var pos: Int
}
class B() : A() {
override var pos: Int = 2
}
fun box(): String {
val a: A = B()
if (a.pos != 2) {
return "fail1: ${a.pos}"
}
if (B().pos != 2) {
return "fail2"
}
a.pos = 3;
if (a.pos != 3) {
return "fail3: ${a.pos}"
}
return "OK"
}