FIR: Properly build nullable suspend function types, and aggregate

modifiers and annotations within KtTypeReference/REFERENCE_TYPE nodes.
This commit is contained in:
Mark Punzalan
2021-04-08 09:35:10 +00:00
committed by TeamCityServer
parent 9cf5ac1fbd
commit 9a4742c08d
35 changed files with 734 additions and 28 deletions
@@ -0,0 +1,23 @@
// DONT_TARGET_EXACT_BACKEND: WASM
// WASM_MUTE_REASON: COROUTINES
// !LANGUAGE: +SuspendConversion
// WITH_RUNTIME
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
fun runSuspend(c: (suspend () -> Unit)?) {
c?.startCoroutine(EmptyContinuation)
}
var test = "failed"
fun foo() { test = "OK" }
fun box(): String {
runSuspend(::foo)
return test
}
@@ -0,0 +1,25 @@
// WITH_RUNTIME
// WITH_COROUTINES
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
x.resume("OK")
COROUTINE_SUSPENDED
}
fun builder(c: (suspend () -> Unit)?) {
c?.startCoroutine(EmptyContinuation)
}
fun box(): String {
var result = ""
builder(null)
builder {
result = suspendHere()
}
return result
}