23 lines
451 B
Kotlin
Vendored
23 lines
451 B
Kotlin
Vendored
// IGNORE_BACKEND: WASM
|
|
// WITH_RUNTIME
|
|
|
|
import kotlin.coroutines.*
|
|
|
|
fun launch(block: suspend (Long) -> String): String {
|
|
var result = ""
|
|
block.startCoroutine(0L, Continuation(EmptyCoroutineContext) { result = it.getOrThrow() })
|
|
return result
|
|
}
|
|
|
|
suspend fun g() {}
|
|
|
|
class C {
|
|
suspend fun f(i: Long): String {
|
|
var x = 0
|
|
listOf<Int>().map { x }
|
|
g()
|
|
return "OK"
|
|
}
|
|
}
|
|
|
|
fun box(): String = launch(C()::f) |