Files
kotlin-fork/compiler/testData/codegen/box/properties/lazyInitializationThroughTopFun.kt
T
2021-10-12 23:29:39 +03:00

20 lines
277 B
Kotlin
Vendored

// TARGET_BACKEND: JS_IR
// IGNORE_BACKEND: WASM
// PROPERTY_LAZY_INITIALIZATION
// FILE: A.kt
var result: String? = null
val a = "a".let {
result = "OK"
it + "a"
}
fun foo() =
2 + 2
// FILE: main.kt
fun box(): String {
val foo = foo()
return result!!
}