Files
kotlin-fork/compiler/testData/codegen/box/properties/lazyInitializationCyclicImports.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

39 lines
539 B
Kotlin
Vendored

// IGNORE_BACKEND: JS
// DONT_TARGET_EXACT_BACKEND: WASM
// PROPERTY_LAZY_INITIALIZATION
// FILE: A.kt
var log = ""
val a1 = "a".also {
log += "a1"
}
val b1 = a2.also {
log += "b1"
}
val c1 = a3.also {
log += "c1"
}
// FILE: B.kt
val a2 = a1.also {
log += "a2"
}
val b2 = "b".also {
log += "b2"
}
// FILE: C.kt
val a3 = b1.also {
log += "a3"
}
val b3 = b2.also {
log += "b3"
}
val c3 = "c".also {
log += "c3"
}
// FILE: main.kt
fun box(): String = if (log == "a1a2b2b1a3b3c3c1") "OK" else "fail: $log"