Files
kotlin-fork/compiler/testData/codegen/boxInline/suspend/callableReference/simple.kt
T
Ilmir Usmanov d7fd2471b8 JVM IR: Remove remains of 1.2 coroutines from tests
Remove CoroutineAdapter and LANGUAGE: +ReleaseContinuation,
which are meaninless now.
Update the tests accordingly.
2023-05-31 05:56:18 +00:00

31 lines
622 B
Kotlin
Vendored

// WITH_COROUTINES
// WITH_STDLIB
// NO_CHECK_LAMBDA_INLINING
// FILE: test.kt
inline suspend fun foo(x: suspend () -> String) = x()
// FILE: box.kt
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
fun builder(c: suspend () -> Unit) {
c.startCoroutine(object: Continuation<Unit> {
override val context: CoroutineContext get() = EmptyCoroutineContext
override fun resumeWith(value: Result<Unit>) {
value.getOrThrow()
}
})
}
suspend fun String.id() = this
fun box(): String {
var res = ""
builder {
res = foo("OK"::id)
}
return res
}