Files
kotlin-fork/js/js.translator/testData/box/main/suspendMainNoArgs.kt
T
Roman Artemev 5bd3bcd237 [JS IR BE] Support main function
* Implement IR-based main function detector
2019-04-26 17:04:28 +03:00

24 lines
354 B
Kotlin
Vendored

// EXPECTED_REACHABLE_NODES: 1296
// CALL_MAIN
import kotlin.coroutines.*
var ok: String = "fail"
var callback: () -> Unit = {}
suspend fun main() {
suspendCoroutine<Unit> { cont ->
callback = {
cont.resume(Unit)
}
}
ok = "OK"
}
fun box(): String {
assertEquals("fail", ok)
callback()
return ok
}