Replace trivial usages of suspendCoroutineOrReturn in tests
This is necessary since suspendCoroutineOrReturn gets removed in 1.3
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun suspendHere(ctx: CoroutineContext) = suspendCoroutineOrReturn<String> { x ->
|
||||
suspend fun suspendHere(ctx: CoroutineContext) = suspendCoroutineUninterceptedOrReturn<String> { x ->
|
||||
if (x.context == ctx) x.resume("OK") else x.resume("FAIL")
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ suspend fun mustBeTailCall(): String {
|
||||
}
|
||||
|
||||
suspend fun retrieveCoroutineContext(): CoroutineContext =
|
||||
suspendCoroutineOrReturn { cont -> cont.context }
|
||||
suspendCoroutineUninterceptedOrReturn { cont -> cont.context }
|
||||
|
||||
suspend fun notTailCall(): String {
|
||||
return suspendHere(retrieveCoroutineContext())
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
suspend fun suspendHere() = suspendCoroutineOrReturn<String> { x ->
|
||||
suspend fun suspendHere() = suspendCoroutineUninterceptedOrReturn<String> { x ->
|
||||
x.resume("OK")
|
||||
}
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ private suspend fun withoutInline() {
|
||||
if (p > 52158) Unit else COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
return suspendCoroutineOrReturn(c)
|
||||
return suspendCoroutineUninterceptedOrReturn(c)
|
||||
}
|
||||
|
||||
private suspend fun withInline() {
|
||||
return suspendCoroutineOrReturn { c ->
|
||||
return suspendCoroutineUninterceptedOrReturn { c ->
|
||||
if (p > 52158) Unit else COROUTINE_SUSPENDED
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user