Add test for KT-48478

This commit is contained in:
pyos
2021-09-03 13:42:52 +02:00
committed by max-kammerer
parent 72752b64c5
commit 8724bc9525
9 changed files with 65 additions and 0 deletions
@@ -0,0 +1,22 @@
// WITH_COROUTINES
// WITH_RUNTIME
// IGNORE_BACKEND: WASM
import helpers.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
suspend fun foo(x: suspend () -> Unit) = x()
suspend fun bar(): Int = suspendCoroutineUninterceptedOrReturn<Int> {
it.resume(1)
COROUTINE_SUSPENDED
}
fun box(): String {
var result = ""
suspend {
foo(::bar)
result += "OK"
}.startCoroutine(EmptyContinuation)
return result
}