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

20 lines
423 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1112
package foo
class B(val name: String)
class A(val a: Int, var b: B) {
var copyB: B
init {
copyB = b
}
}
fun box(): String {
val a = A(5, B("OK"))
if (a.a != 5) return "a.a != 5, it: ${a.a}"
if (a.b.name != "OK") return "a.b.name != 'OK', it: ${a.b.name}"
if (a.copyB!!.name != "OK") return "a.b.name != 'OK', it: ${a.copyB!!.name}"
return "OK"
}