Files
kotlin-fork/compiler/testData/codegen/box/properties/lazyInitializationThroughTopFun.kt
T
2021-10-02 06:14:35 +00:00

17 lines
290 B
Kotlin
Vendored

// TARGET_BACKEND: JS_IR
// IGNORE_BACKEND: WASM
// PROPERTY_LAZY_INITIALIZATION
// FILE: A.kt
val a = "a".let {
it + "a"
}
fun foo() =
2 + 2
// FILE: main.kt
fun box(): String {
val foo = foo()
return if (js("typeof a") == "string" && js("a") == "aa") "OK" else "fail"
}