Add ContinuationAdapter to coroutine tests helpers
It allows having the same Continuation implementations for different API versions
This commit is contained in:
+4
-2
@@ -1,6 +1,7 @@
|
||||
// FILE: inlined.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// NO_CHECK_LAMBDA_INLINING
|
||||
|
||||
suspend inline fun crossinlineMe(crossinline c: suspend () -> Unit) {
|
||||
@@ -17,6 +18,7 @@ suspend inline fun crossinlineMe2(crossinline c: suspend () -> Unit) {
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import helpers.*
|
||||
|
||||
var result = "FAIL"
|
||||
var i = 0
|
||||
@@ -30,7 +32,7 @@ suspend fun suspendHere() = suspendCoroutine<Unit> { c ->
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
val continuation = object: Continuation<Unit> {
|
||||
val continuation = object: ContinuationAdapter<Unit>() {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
@@ -67,4 +69,4 @@ fun box(): String {
|
||||
proceed()
|
||||
if (!finished) return "resume on root continuation is not called"
|
||||
return result
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user