eea95441c5
#KT-16908: Fixed
38 lines
761 B
Kotlin
Vendored
38 lines
761 B
Kotlin
Vendored
// IGNORE_BACKEND: JS, JS_IR
|
|
// NO_CHECK_LAMBDA_INLINING
|
|
// FILE: test.kt
|
|
// COMMON_COROUTINES_TEST
|
|
|
|
inline suspend fun foo(x: suspend () -> String) = x()
|
|
|
|
// FILE: box.kt
|
|
// WITH_RUNTIME
|
|
// COMMON_COROUTINES_TEST
|
|
|
|
import COROUTINES_PACKAGE.*
|
|
import COROUTINES_PACKAGE.intrinsics.*
|
|
|
|
fun builder(c: suspend () -> Unit) {
|
|
c.startCoroutine(object: Continuation<Unit> {
|
|
override val context: CoroutineContext
|
|
get() = EmptyCoroutineContext
|
|
|
|
override fun resume(value: Unit) {
|
|
}
|
|
|
|
override fun resumeWithException(exception: Throwable) {
|
|
throw exception
|
|
}
|
|
})
|
|
}
|
|
|
|
suspend fun String.id() = this
|
|
|
|
fun box(): String {
|
|
var res = ""
|
|
builder {
|
|
res = foo("OK"::id)
|
|
}
|
|
return res
|
|
}
|