blob: 896556e4ecde9b5b3025f7368a809a49e618a051 [file]
// WITH_COROUTINES
// WITH_STDLIB
// FILE: test.kt
package test
inline suspend fun f(crossinline x: suspend () -> Unit) =
object { suspend fun foo() = x() }.foo()
// FILE: main.kt
import test.*
import kotlin.coroutines.*
import helpers.*
inline suspend fun g(crossinline x: suspend () -> Unit) =
f(x)
var result: String = "fail"
inline suspend fun h(crossinline x: suspend () -> String) =
g { result = x() }
fun box(): String {
suspend { h { "OK" } }.startCoroutine(EmptyContinuation)
return result
}