Files
kotlin-fork/compiler/testData/codegen/box/properties/lazyInitializationOrder.kt
T
Ilya Goncharov 697b2b02f1 [JS IR] Add properties lazy initialization with multiple modules
[JS IR] Move tests into compiler/testData

[JS IR] Add cyclic dependencies with lazy property initialization

[JS IR] Add test on not initialization in case of call non properties (classed, objects, enum classes, const vals)

[JS IR] Add initialization through top level

[JS IR] Ignore enum getInstance function in property lazy initialization

[JS IR] Use let function with useful result instead of pure apply and also

[JS IR] Remove duplicated tests in js.translator
2020-12-02 17:35:30 +03:00

36 lines
484 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1239
// DONT_TARGET_EXACT_BACKEND: WASM
// PROPERTY_LAZY_INITIALIZATION
// FILE: A.kt
val a = "A".let {
flag = !flag
if (flag) {
it
} else {
"!A"
}
}
val b = "B".let {
flag = !flag
if (!flag) {
it
} else {
"!B"
}
}
// FILE: B.kt
var flag: Boolean = false
// FILE: main.kt
fun box(): String {
return if (
a == "A" && b == "B"
)
"OK"
else "a = $a; b = ${b}"
}