Replace trivial usages of suspendCoroutineOrReturn in tests
This is necessary since suspendCoroutineOrReturn gets removed in 1.3
This commit is contained in:
+1
-1
@@ -12,7 +12,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var result = ""
|
||||
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
c.resume(value)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ class Controller {
|
||||
i29: Int = 1,
|
||||
i30: Int = 1,
|
||||
i31: Int = 1
|
||||
): String = suspendCoroutineOrReturn { x ->
|
||||
): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(a + "#" + (i1 + i2 + i3 + i4 + i5 + i6 + i7 + i8 + i9 + i10 + i11 + i12 + i13 + i14 + i15 + i16 + i17 + i18 + i19 + i20 + i21 + i22 + i23 + i24 + i25 + i26 + i27 + i28 + i29 + i30 + i31))
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ fun builder(c: suspend () -> Unit) {
|
||||
}
|
||||
|
||||
class A {
|
||||
suspend private fun a(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend private fun a(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -40,14 +40,14 @@ class AsyncGeneratorIterator<T>: AsyncIterator<T>, AsyncGenerator<T>, Continuati
|
||||
|
||||
override val context = EmptyCoroutineContext
|
||||
|
||||
suspend fun computeHasNext(): Boolean = suspendCoroutineOrReturn { c ->
|
||||
suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
computesNext = false
|
||||
computeContinuation = c
|
||||
nextStep!!.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
suspend fun computeNext(): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
computesNext = true
|
||||
computeContinuation = c
|
||||
nextStep!!.resume(Unit)
|
||||
@@ -97,7 +97,7 @@ class AsyncGeneratorIterator<T>: AsyncIterator<T>, AsyncGenerator<T>, Continuati
|
||||
}
|
||||
|
||||
// Generator implementation
|
||||
override suspend fun yield(value: T): Unit = suspendCoroutineOrReturn { c ->
|
||||
override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
computedNext = true
|
||||
nextValue = value
|
||||
nextStep = c
|
||||
|
||||
@@ -40,14 +40,14 @@ class AsyncGeneratorIterator<T>: AsyncIterator<T>, AsyncGenerator<T>, Continuati
|
||||
|
||||
override val context = EmptyCoroutineContext
|
||||
|
||||
suspend fun computeHasNext(): Boolean = suspendCoroutineOrReturn { c ->
|
||||
suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
computesNext = false
|
||||
computeContinuation = c
|
||||
nextStep!!.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
suspend fun computeNext(): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
computesNext = true
|
||||
computeContinuation = c
|
||||
nextStep!!.resume(Unit)
|
||||
@@ -97,7 +97,7 @@ class AsyncGeneratorIterator<T>: AsyncIterator<T>, AsyncGenerator<T>, Continuati
|
||||
}
|
||||
|
||||
// Generator implementation
|
||||
override suspend fun yield(value: T): Unit = suspendCoroutineOrReturn { c ->
|
||||
override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
computedNext = true
|
||||
nextValue = value
|
||||
nextStep = c
|
||||
|
||||
@@ -40,14 +40,14 @@ class AsyncGeneratorIterator<T>: AsyncIterator<T>, AsyncGenerator<T>, Continuati
|
||||
|
||||
override val context = EmptyCoroutineContext
|
||||
|
||||
suspend fun computeHasNext(): Boolean = suspendCoroutineOrReturn { c ->
|
||||
suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
computesNext = false
|
||||
computeContinuation = c
|
||||
nextStep!!.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
suspend fun computeNext(): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
computesNext = true
|
||||
computeContinuation = c
|
||||
nextStep!!.resume(Unit)
|
||||
@@ -97,7 +97,7 @@ class AsyncGeneratorIterator<T>: AsyncIterator<T>, AsyncGenerator<T>, Continuati
|
||||
}
|
||||
|
||||
// Generator implementation
|
||||
override suspend fun yield(value: T): Unit = suspendCoroutineOrReturn { c ->
|
||||
override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
computedNext = true
|
||||
nextValue = value
|
||||
nextStep = c
|
||||
|
||||
@@ -7,7 +7,7 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun suspendHere(): Any = suspendCoroutineOrReturn { x -> }
|
||||
suspend fun suspendHere(): Any = suspendCoroutineUninterceptedOrReturn { x -> }
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
var exception: Throwable? = null
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
suspend fun suspendHere(): Any = suspendCoroutineOrReturn { x ->}
|
||||
suspend fun suspendHere(): Any = suspendCoroutineUninterceptedOrReturn { x ->}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
try {
|
||||
|
||||
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
|
||||
suspend fun <T> await(t: T): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun <T> await(t: T): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
c.resume(t)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var result = ""
|
||||
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
c.resume(value)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var result = ""
|
||||
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
c.resume(value)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var result = ""
|
||||
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
c.resume(value)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var result = ""
|
||||
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
c.resume(value)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var result = ""
|
||||
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
c.resume(value)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var result = ""
|
||||
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
c.resume(value)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var result = ""
|
||||
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
c.resume(value)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ fun box(): String {
|
||||
return "OK"
|
||||
}
|
||||
|
||||
suspend fun suspendAndContinue(): Unit = suspendCoroutineOrReturn { c ->
|
||||
suspend fun suspendAndContinue(): Unit = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
postponed = {
|
||||
c.resume(Unit)
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var result = ""
|
||||
|
||||
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
result += "suspend($value);"
|
||||
c.resume(value)
|
||||
COROUTINE_SUSPENDED
|
||||
|
||||
@@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var result = ""
|
||||
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
result += "["
|
||||
c.resume(value)
|
||||
COROUTINE_SUSPENDED
|
||||
|
||||
@@ -11,14 +11,14 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var result = ""
|
||||
|
||||
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
result += "suspend($value);"
|
||||
c.resume(value)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
// Tail calls are not allowed to be Nothing typed. See KT-15051
|
||||
suspend fun suspendLogAndThrow(exception: Throwable): Any? = suspendCoroutineOrReturn { c ->
|
||||
suspend fun suspendLogAndThrow(exception: Throwable): Any? = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
result += "throw(${exception.message});"
|
||||
c.resumeWithException(exception)
|
||||
COROUTINE_SUSPENDED
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var result = ""
|
||||
|
||||
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
result += "suspend($value);"
|
||||
c.resume(value)
|
||||
COROUTINE_SUSPENDED
|
||||
|
||||
@@ -12,7 +12,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var result = ""
|
||||
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
c.resume(value)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
var result = false
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ class A<T : String> {
|
||||
|
||||
suspend fun bar(): T {
|
||||
foo()
|
||||
return suspendCoroutineOrReturn { x ->
|
||||
return suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(x.toString() as T)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ class A<T : String> {
|
||||
|
||||
suspend fun bar(): T {
|
||||
foo()
|
||||
return suspendCoroutineOrReturn { x ->
|
||||
return suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(x.toString() as T)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(a: String = "abc", i: Int = 2): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(a: String = "abc", i: Int = 2): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(a + "#" + (i + 1))
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
var result = 0
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
result++
|
||||
x.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
|
||||
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun <T> suspendHere(v: T): T = suspendCoroutineOrReturn { x ->
|
||||
suspend fun <T> suspendHere(v: T): T = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(v)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class A {
|
||||
var result = mutableListOf("O", "K", null)
|
||||
suspend fun foo(): String? = suspendCoroutineOrReturn { x ->
|
||||
suspend fun foo(): String? = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(result.removeAt(0))
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend inline fun Long.longArgs(a: Long, b: Long, c: Long) = suspendCoroutineOrReturn<Long> {
|
||||
suspend inline fun Long.longArgs(a: Long, b: Long, c: Long) = suspendCoroutineUninterceptedOrReturn<Long> {
|
||||
it.resume(this + a + b + c)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
@@ -22,4 +22,4 @@ fun box(): String {
|
||||
res = ref(1L, 1L, 1L)
|
||||
}
|
||||
return if (res == 4L) "OK" else "FAIL $res"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class A(val w: String) {
|
||||
suspend fun String.ext(): String = suspendCoroutineOrReturn {
|
||||
suspend fun String.ext(): String = suspendCoroutineUninterceptedOrReturn {
|
||||
x ->
|
||||
x.resume(this + w)
|
||||
COROUTINE_SUSPENDED
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
class A(val w: String) {
|
||||
suspend fun Long.ext(): String = suspendCoroutineOrReturn {
|
||||
suspend fun Long.ext(): String = suspendCoroutineUninterceptedOrReturn {
|
||||
x ->
|
||||
x.resume(this.toString() + w)
|
||||
COROUTINE_SUSPENDED
|
||||
|
||||
Vendored
+1
-1
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
data class A(val o: String) {
|
||||
operator suspend fun component2(): String = suspendCoroutineOrReturn { x ->
|
||||
operator suspend fun component2(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume("K")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun suspendThere(v: A): A = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendThere(v: A): A = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(v)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
@@ -31,4 +31,4 @@ fun box(): String {
|
||||
var a = A("")
|
||||
builder { a = usePlusAssign() }
|
||||
return a.value
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -8,7 +8,7 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun suspendThere(v: A): A = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendThere(v: A): A = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(v)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
@@ -33,4 +33,4 @@ fun box(): String {
|
||||
var a = A("")
|
||||
builder { a = usePlusAssign() }
|
||||
return a.value
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -8,7 +8,7 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun suspendThere(v: A): A = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendThere(v: A): A = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(v)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
suspend fun ArrayList<Int>.yield(v: Int): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun ArrayList<Int>.yield(v: Int): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
this.add(v)
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
|
||||
+1
-1
@@ -57,7 +57,7 @@ class GeneratedIterator<T>(block: suspend Generator<T>.() -> Unit) : AbstractIte
|
||||
override fun computeNext() {
|
||||
nextStep.resume(Unit)
|
||||
}
|
||||
suspend override fun yield(value: T) = suspendCoroutineOrReturn<Unit> { c ->
|
||||
suspend override fun yield(value: T) = suspendCoroutineUninterceptedOrReturn<Unit> { c ->
|
||||
setNext(value)
|
||||
nextStep = c
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class Controller {
|
||||
var exception: Throwable? = null
|
||||
val postponedActions = ArrayList<() -> Unit>()
|
||||
|
||||
suspend fun suspendWithValue(v: String): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendWithValue(v: String): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
postponedActions.add {
|
||||
x.resume(v)
|
||||
}
|
||||
@@ -19,7 +19,7 @@ class Controller {
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendWithException(e: Exception): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
postponedActions.add {
|
||||
x.resumeWithException(e)
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var log = ""
|
||||
|
||||
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineOrReturn { x ->
|
||||
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
log += "suspend($value);"
|
||||
x.resume(value)
|
||||
COROUTINE_SUSPENDED
|
||||
|
||||
@@ -8,7 +8,7 @@ import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import helpers.*
|
||||
import kotlin.coroutines.experimental.*
|
||||
import kotlin.coroutines.experimental.intrinsics.*
|
||||
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun suspendThere(v: Any?): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendThere(v: Any?): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(v?.toString() ?: "<empty>")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(v)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class Controller {
|
||||
x.resume(v)
|
||||
}
|
||||
|
||||
suspend inline fun suspendInline(v: String): String = suspendCoroutineOrReturn { x ->
|
||||
suspend inline fun suspendInline(v: String): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
withValue(v, x)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ var wasCalled = false
|
||||
class Controller {
|
||||
val postponedActions = mutableListOf<() -> Unit>()
|
||||
|
||||
suspend fun suspendWithValue(v: String): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendWithValue(v: String): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
postponedActions.add {
|
||||
x.resume(v)
|
||||
}
|
||||
@@ -20,7 +20,7 @@ class Controller {
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendWithException(e: Exception): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
postponedActions.add {
|
||||
x.resumeWithException(e)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
var i = 0
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume((i++).toString())
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -10,13 +10,13 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun runInstanceOf(): Boolean = suspendCoroutineOrReturn { x ->
|
||||
suspend fun runInstanceOf(): Boolean = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
val y: Any = x
|
||||
x.resume(x is Continuation<*>)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
suspend fun runCast(): Boolean = suspendCoroutineOrReturn { x ->
|
||||
suspend fun runCast(): Boolean = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
val y: Any = x
|
||||
x.resume(Continuation::class.isInstance(y as Continuation<*>))
|
||||
COROUTINE_SUSPENDED
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+2
-2
@@ -8,12 +8,12 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
suspend fun suspendWithException(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendWithException(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resumeWithException(RuntimeException("OK"))
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -8,12 +8,12 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
suspend fun suspendWithException(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendWithException(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resumeWithException(RuntimeException("OK"))
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun <V> suspendHere(v: V): V = suspendCoroutineOrReturn { x ->
|
||||
suspend fun <V> suspendHere(v: V): V = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(v)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,7 +6,7 @@
|
||||
import helpers.*
|
||||
|
||||
import COROUTINES_PACKAGE.intrinsics.COROUTINE_SUSPENDED
|
||||
import COROUTINES_PACKAGE.intrinsics.suspendCoroutineOrReturn
|
||||
import COROUTINES_PACKAGE.intrinsics.suspendCoroutineUninterceptedOrReturn
|
||||
import COROUTINES_PACKAGE.*
|
||||
|
||||
class Bar(val x: Any)
|
||||
@@ -26,7 +26,7 @@ class Foo(val value: Any) {
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+2
-2
@@ -10,8 +10,8 @@ import COROUTINES_PACKAGE.*
|
||||
|
||||
class A {
|
||||
var isMinusAssignCalled = false
|
||||
operator suspend fun minusAssign(y: String): Unit = suspendCoroutineOrReturn { x ->
|
||||
if (y != "56") return@suspendCoroutineOrReturn Unit
|
||||
operator suspend fun minusAssign(y: String): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
if (y != "56") return@suspendCoroutineUninterceptedOrReturn Unit
|
||||
isMinusAssignCalled = true
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
|
||||
@@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var result = ""
|
||||
var ok = false
|
||||
suspend fun suspendHere(v: String): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(v: String): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
result += v
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
|
||||
@@ -7,7 +7,7 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var ok = false
|
||||
var v = "fail"
|
||||
suspend fun suspendHere(v: String): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(v: String): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
this.v = v
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
|
||||
@@ -7,7 +7,7 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun suspendWithValue(result: () -> String): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendWithValue(result: () -> String): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(result())
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.COROUTINE_SUSPENDED
|
||||
import COROUTINES_PACKAGE.intrinsics.suspendCoroutineOrReturn
|
||||
import COROUTINES_PACKAGE.intrinsics.suspendCoroutineUninterceptedOrReturn
|
||||
|
||||
class OkDelegate {
|
||||
operator fun getValue(receiver: Any?, property: Any?): String = "OK"
|
||||
}
|
||||
|
||||
suspend fun <T> suspendWithValue(value: T): T = suspendCoroutineOrReturn { c ->
|
||||
suspend fun <T> suspendWithValue(value: T): T = suspendCoroutineUninterceptedOrReturn { c ->
|
||||
c.resume(value)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun callLocal(a: String, b: String): String {
|
||||
suspend fun local() = suspendCoroutineOrReturn<String> {
|
||||
suspend fun local() = suspendCoroutineUninterceptedOrReturn<String> {
|
||||
it.resume(a + b)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
suspend fun callLocal(): String {
|
||||
val a = "O"
|
||||
val b = "K"
|
||||
suspend fun local() = suspendCoroutineOrReturn<String> {
|
||||
suspend fun local() = suspendCoroutineUninterceptedOrReturn<String> {
|
||||
it.resume(a + b)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun callLocal(): String {
|
||||
suspend fun String.local() = suspendCoroutineOrReturn<String> {
|
||||
suspend fun String.local() = suspendCoroutineUninterceptedOrReturn<String> {
|
||||
it.resume(this)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun callLocal(): String {
|
||||
suspend infix fun String.local(a: String) = suspendCoroutineOrReturn<String> {
|
||||
suspend infix fun String.local(a: String) = suspendCoroutineUninterceptedOrReturn<String> {
|
||||
it.resume(this + a)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun callLocal(): String {
|
||||
val l: suspend () -> String = {
|
||||
suspend fun local() = suspendCoroutineOrReturn<String> {
|
||||
suspend fun local() = suspendCoroutineUninterceptedOrReturn<String> {
|
||||
it.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun callLocal(): String {
|
||||
suspend fun local() = suspendCoroutineOrReturn<String> {
|
||||
suspend fun local() = suspendCoroutineUninterceptedOrReturn<String> {
|
||||
it.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun callLocal(a: String, b: String): String {
|
||||
suspend fun local(a: String, b: String) = suspendCoroutineOrReturn<String> {
|
||||
suspend fun local(a: String, b: String) = suspendCoroutineUninterceptedOrReturn<String> {
|
||||
it.resume(a + b)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -7,12 +7,12 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun getLong(): Long = suspendCoroutineOrReturn { x ->
|
||||
suspend fun getLong(): Long = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(1234567890123L)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
suspend fun suspendHere(r: LongRange): Long = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(r: LongRange): Long = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(r.start + r.endInclusive)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun suspendHere(r: LongRange): Long = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(r: LongRange): Long = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(r.start + r.endInclusive)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ suspend fun foo(y: A?): String {
|
||||
return res
|
||||
}
|
||||
|
||||
suspend fun baz(y: String): Unit = suspendCoroutineOrReturn { x ->
|
||||
suspend fun baz(y: String): Unit = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
res += y[res.length]
|
||||
x.resume(Unit)
|
||||
COROUTINE_SUSPENDED
|
||||
|
||||
@@ -16,7 +16,7 @@ var continuation: () -> Unit = { }
|
||||
var log = ""
|
||||
var finished = false
|
||||
|
||||
suspend fun <T> foo(v: T): T = suspendCoroutineOrReturn { x ->
|
||||
suspend fun <T> foo(v: T): T = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
continuation = {
|
||||
x.resume(v)
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ var continuation: () -> Unit = { }
|
||||
var log = ""
|
||||
var finished = false
|
||||
|
||||
suspend fun <T> foo(v: T): T = suspendCoroutineOrReturn { x ->
|
||||
suspend fun <T> foo(v: T): T = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
continuation = {
|
||||
x.resume(v)
|
||||
}
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ class C {
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun <T> foo(v: T): T = suspendCoroutineOrReturn { x ->
|
||||
suspend fun <T> foo(v: T): T = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
continuation = {
|
||||
x.resume(v)
|
||||
}
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ var continuation: () -> Unit = { }
|
||||
var log = ""
|
||||
var finished = false
|
||||
|
||||
suspend fun <T> foo(v: T): T = suspendCoroutineOrReturn { x ->
|
||||
suspend fun <T> foo(v: T): T = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
continuation = {
|
||||
x.resume(v)
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var lastSuspension: Continuation<String>? = null
|
||||
var result = "fail"
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
lastSuspension = x
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var lastSuspension: Continuation<String>? = null
|
||||
var result = "fail"
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
lastSuspension = x
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var lastSuspension: Continuation<String>? = null
|
||||
var result = "fail"
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
lastSuspension = x
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
class Controller {
|
||||
var lastSuspension: Continuation<String>? = null
|
||||
var result = "fail"
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
lastSuspension = x
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ var wasCalled = false
|
||||
class Controller {
|
||||
val postponedActions = ArrayList<() -> Unit>()
|
||||
|
||||
suspend fun suspendWithValue(v: String): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendWithValue(v: String): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
postponedActions.add {
|
||||
x.resume(v)
|
||||
}
|
||||
@@ -20,7 +20,7 @@ class Controller {
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendWithException(e: Exception): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
postponedActions.add {
|
||||
x.resumeWithException(e)
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
var cResult = 0
|
||||
suspend fun suspendHere(v: Int): Int = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(v: Int): Int = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(v * 2)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
var cResult = 0
|
||||
suspend fun suspendHere(v: Int): Int = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(v: Int): Int = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(v * 2)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ fun box(): String {
|
||||
|
||||
suspend fun factorial(a: Int): Int = if (a > 0) suspendHere(factorial(a - 1) * a) else suspendHere(1)
|
||||
|
||||
suspend fun suspendHere(value: Int): Int = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(value: Int): Int = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
postponed = {
|
||||
log += "$value;"
|
||||
x.resume(value)
|
||||
|
||||
@@ -7,7 +7,7 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resumeWithException(RuntimeException("OK"))
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume("OK")
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
@@ -8,10 +8,10 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
class Controller {
|
||||
suspend fun suspendHere(): Int = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendHere(): Int = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
1
|
||||
}
|
||||
suspend fun suspendThere(): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendThere(): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
"?"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
var globalResult = ""
|
||||
suspend fun suspendWithValue(v: String): String = suspendCoroutineOrReturn { x ->
|
||||
suspend fun suspendWithValue(v: String): String = suspendCoroutineUninterceptedOrReturn { x ->
|
||||
x.resume(v)
|
||||
COROUTINE_SUSPENDED
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user