Files
kotlin-fork/backend.native/tests/external/codegen/box/classes/classObjectAsStaticInitializer.kt
T
2017-11-09 12:48:21 +03:00

22 lines
292 B
Kotlin

// IGNORE_BACKEND: NATIVE
var global = 0;
class C {
companion object {
init {
global = 1;
}
}
}
fun box(): String {
if (global != 0) {
return "fail1: global = $global"
}
val c = C()
if (global == 1) return "OK" else return "fail2: global = $global"
}