// WITH_STDLIB // WITH_COROUTINES // DONT_TARGET_EXACT_BACKEND: JVM // DONT_TARGET_EXACT_BACKEND: JS import kotlin.coroutines.* public inline fun myEmptyArray(): Array = arrayOfNulls(0) as Array inline fun Array?.myOrEmpty(): Array = this ?: myEmptyArray() fun runBlocking(c: suspend () -> T): T { var res: T? = null c.startCoroutine(Continuation(EmptyCoroutineContext) { res = it.getOrThrow() }) return res!! } suspend fun suspendHere(x: String) {} suspend fun main() { arrayOf("1").myOrEmpty().forEach { suspendHere(it) } } fun box(): String { runBlocking(::main) return "OK" }