Files
kotlin-fork/compiler/testData/codegen/box/classes/classObjectAsStaticInitializer.kt
T
Pavel Kunyavskiy 733ca5a358 [K/N] Unmute tests already working on native
Also, add issue references for some tests
2023-06-06 14:29:21 +00:00

32 lines
452 B
Kotlin
Vendored

// IGNORE_BACKEND: WASM
// WASM_MUTE_REASON: IGNORED_IN_JS
// KT-59058
// IGNORE_BACKEND: NATIVE
var global = "A"
class C {
init {
global += "D"
}
companion object {
init {
global += "B"
}
init {
global += "C"
}
}
}
fun box(): String {
if (global != "A") {
return "fail1: global = $global"
}
val c = C()
if (global == "ABCD") return "OK" else return "fail2: global = $global"
}