[K/N] Disable scope initialization on constant access
^KT-57098
This commit is contained in:
committed by
Space Team
parent
e6297f92fa
commit
62fb3df7f0
@@ -0,0 +1,19 @@
|
||||
// IGNORE_BACKEND: WASM
|
||||
// IGNORE_BACKEND_K1: JS_IR, JS_IR_ES6
|
||||
var initialized = 0
|
||||
|
||||
object O {
|
||||
init {
|
||||
initialized += 1
|
||||
}
|
||||
const val x = 1
|
||||
val y = 2
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
if (O.x != 1) return "FAIL 1"
|
||||
if (initialized != 0) return "FAIL 2"
|
||||
if (O.y != 2) return "FAIL 3"
|
||||
if (initialized != 1) return "FAIL 4"
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user