Rename SUSPENDED_MARKER to COROUTINE_SUSPENDED
This commit is contained in:
+1
-1
@@ -24,7 +24,7 @@ import org.jetbrains.kotlin.resolve.DescriptorUtils
|
|||||||
import org.jetbrains.kotlin.resolve.descriptorUtil.module
|
import org.jetbrains.kotlin.resolve.descriptorUtil.module
|
||||||
|
|
||||||
val SUSPEND_COROUTINE_OR_RETURN_NAME = Name.identifier("suspendCoroutineOrReturn")
|
val SUSPEND_COROUTINE_OR_RETURN_NAME = Name.identifier("suspendCoroutineOrReturn")
|
||||||
val SUSPENDED_MARKER_NAME = Name.identifier("SUSPENDED_MARKER")
|
val COROUTINE_SUSPENDED_NAME = Name.identifier("COROUTINE_SUSPENDED")
|
||||||
|
|
||||||
val COROUTINES_INTRINSICS_PACKAGE_FQ_NAME = DescriptorUtils.COROUTINES_PACKAGE_FQ_NAME.child(Name.identifier("intrinsics"))
|
val COROUTINES_INTRINSICS_PACKAGE_FQ_NAME = DescriptorUtils.COROUTINES_PACKAGE_FQ_NAME.child(Name.identifier("intrinsics"))
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -102,7 +102,7 @@ class CoroutineTransformerMethodVisitor(
|
|||||||
// tableswitch(this.label)
|
// tableswitch(this.label)
|
||||||
insertBefore(firstToInsertBefore,
|
insertBefore(firstToInsertBefore,
|
||||||
insnListOf(
|
insnListOf(
|
||||||
*withInstructionAdapter { loadSuspendMarker() }.toArray(),
|
*withInstructionAdapter { loadCoroutineSuspendedMarker() }.toArray(),
|
||||||
VarInsnNode(Opcodes.ASTORE, suspendMarkerVarIndex),
|
VarInsnNode(Opcodes.ASTORE, suspendMarkerVarIndex),
|
||||||
VarInsnNode(Opcodes.ALOAD, 0),
|
VarInsnNode(Opcodes.ALOAD, 0),
|
||||||
FieldInsnNode(
|
FieldInsnNode(
|
||||||
|
|||||||
+3
-3
@@ -18,7 +18,7 @@ package org.jetbrains.kotlin.codegen.coroutines
|
|||||||
|
|
||||||
import com.intellij.openapi.project.Project
|
import com.intellij.openapi.project.Project
|
||||||
import org.jetbrains.kotlin.backend.common.COROUTINES_INTRINSICS_PACKAGE_FQ_NAME
|
import org.jetbrains.kotlin.backend.common.COROUTINES_INTRINSICS_PACKAGE_FQ_NAME
|
||||||
import org.jetbrains.kotlin.backend.common.SUSPENDED_MARKER_NAME
|
import org.jetbrains.kotlin.backend.common.COROUTINE_SUSPENDED_NAME
|
||||||
import org.jetbrains.kotlin.backend.common.isBuiltInSuspendCoroutineOrReturn
|
import org.jetbrains.kotlin.backend.common.isBuiltInSuspendCoroutineOrReturn
|
||||||
import org.jetbrains.kotlin.builtins.isBuiltinFunctionalType
|
import org.jetbrains.kotlin.builtins.isBuiltinFunctionalType
|
||||||
import org.jetbrains.kotlin.codegen.StackValue
|
import org.jetbrains.kotlin.codegen.StackValue
|
||||||
@@ -285,10 +285,10 @@ fun createMethodNodeForSuspendCoroutineOrReturn(
|
|||||||
fun <D : CallableDescriptor?> D.unwrapInitialDescriptorForSuspendFunction(): D =
|
fun <D : CallableDescriptor?> D.unwrapInitialDescriptorForSuspendFunction(): D =
|
||||||
this.safeAs<SimpleFunctionDescriptor>()?.getUserData(INITIAL_DESCRIPTOR_FOR_SUSPEND_FUNCTION) as D ?: this
|
this.safeAs<SimpleFunctionDescriptor>()?.getUserData(INITIAL_DESCRIPTOR_FOR_SUSPEND_FUNCTION) as D ?: this
|
||||||
|
|
||||||
fun InstructionAdapter.loadSuspendMarker() {
|
fun InstructionAdapter.loadCoroutineSuspendedMarker() {
|
||||||
invokestatic(
|
invokestatic(
|
||||||
COROUTINES_INTRINSICS_FILE_FACADE_INTERNAL_NAME.internalName,
|
COROUTINES_INTRINSICS_FILE_FACADE_INTERNAL_NAME.internalName,
|
||||||
"get$SUSPENDED_MARKER_NAME",
|
"get$COROUTINE_SUSPENDED_NAME",
|
||||||
Type.getMethodDescriptor(AsmTypes.OBJECT_TYPE),
|
Type.getMethodDescriptor(AsmTypes.OBJECT_TYPE),
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ fun builder(c: suspend () -> Unit) {
|
|||||||
class A {
|
class A {
|
||||||
suspend private fun a(): String = suspendCoroutineOrReturn { x ->
|
suspend private fun a(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun myfun(): String {
|
suspend fun myfun(): String {
|
||||||
|
|||||||
@@ -40,14 +40,14 @@ class AsyncGeneratorIterator<T>: AsyncIterator<T>, AsyncGenerator<T>, Continuati
|
|||||||
computesNext = false
|
computesNext = false
|
||||||
computeContinuation = c
|
computeContinuation = c
|
||||||
nextStep!!.resume(Unit)
|
nextStep!!.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun computeNext(): T = suspendCoroutineOrReturn { c ->
|
suspend fun computeNext(): T = suspendCoroutineOrReturn { c ->
|
||||||
computesNext = true
|
computesNext = true
|
||||||
computeContinuation = c
|
computeContinuation = c
|
||||||
nextStep!!.resume(Unit)
|
nextStep!!.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
@@ -98,7 +98,7 @@ class AsyncGeneratorIterator<T>: AsyncIterator<T>, AsyncGenerator<T>, Continuati
|
|||||||
nextValue = value
|
nextValue = value
|
||||||
nextStep = c
|
nextStep = c
|
||||||
resumeIterator(null)
|
resumeIterator(null)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,14 +40,14 @@ class AsyncGeneratorIterator<T>: AsyncIterator<T>, AsyncGenerator<T>, Continuati
|
|||||||
computesNext = false
|
computesNext = false
|
||||||
computeContinuation = c
|
computeContinuation = c
|
||||||
nextStep!!.resume(Unit)
|
nextStep!!.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun computeNext(): T = suspendCoroutineOrReturn { c ->
|
suspend fun computeNext(): T = suspendCoroutineOrReturn { c ->
|
||||||
computesNext = true
|
computesNext = true
|
||||||
computeContinuation = c
|
computeContinuation = c
|
||||||
nextStep!!.resume(Unit)
|
nextStep!!.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("UNCHECKED_CAST")
|
@Suppress("UNCHECKED_CAST")
|
||||||
@@ -98,7 +98,7 @@ class AsyncGeneratorIterator<T>: AsyncIterator<T>, AsyncGenerator<T>, Continuati
|
|||||||
nextValue = value
|
nextValue = value
|
||||||
nextStep = c
|
nextStep = c
|
||||||
resumeIterator(null)
|
resumeIterator(null)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun <T> await(t: T): T = suspendCoroutineOrReturn { c ->
|
suspend fun <T> await(t: T): T = suspendCoroutineOrReturn { c ->
|
||||||
c.resume(t)
|
c.resume(t)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit): String {
|
fun builder(c: suspend () -> Unit): String {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Controller {
|
|||||||
|
|
||||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||||
c.resume(value)
|
c.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Controller {
|
|||||||
|
|
||||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||||
c.resume(value)
|
c.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Controller {
|
|||||||
|
|
||||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||||
c.resume(value)
|
c.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Controller {
|
|||||||
|
|
||||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||||
c.resume(value)
|
c.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Controller {
|
|||||||
|
|
||||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||||
c.resume(value)
|
c.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Controller {
|
|||||||
|
|
||||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||||
c.resume(value)
|
c.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Controller {
|
|||||||
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineOrReturn { c ->
|
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineOrReturn { c ->
|
||||||
result += "suspend($value);"
|
result += "suspend($value);"
|
||||||
c.resume(value)
|
c.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class Controller {
|
|||||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||||
result += "["
|
result += "["
|
||||||
c.resume(value)
|
c.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,14 +10,14 @@ class Controller {
|
|||||||
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineOrReturn { c ->
|
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineOrReturn { c ->
|
||||||
result += "suspend($value);"
|
result += "suspend($value);"
|
||||||
c.resume(value)
|
c.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
// Tail calls are not allowed to be Nothing typed. See KT-15051
|
// 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? = suspendCoroutineOrReturn { c ->
|
||||||
result += "throw(${exception.message});"
|
result += "throw(${exception.message});"
|
||||||
c.resumeWithException(exception)
|
c.resumeWithException(exception)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -10,7 +10,7 @@ class Controller {
|
|||||||
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineOrReturn { c ->
|
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineOrReturn { c ->
|
||||||
result += "suspend($value);"
|
result += "suspend($value);"
|
||||||
c.resume(value)
|
c.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Controller {
|
|||||||
|
|
||||||
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
suspend fun <T> suspendWithResult(value: T): T = suspendCoroutineOrReturn { c ->
|
||||||
c.resume(value)
|
c.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ class Controller {
|
|||||||
var result = false
|
var result = false
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun foo() {
|
fun foo() {
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// IGNORE_BACKEND: JS
|
// IGNORE_BACKEND: JS
|
||||||
import kotlin.coroutines.experimental.*
|
import kotlin.coroutines.experimental.*
|
||||||
import kotlin.coroutines.experimental.intrinsics.SUSPENDED_MARKER
|
import kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED
|
||||||
|
|
||||||
fun runCustomLambdaAsCoroutine(e: Throwable? = null, x: (Continuation<String>) -> Any?): String {
|
fun runCustomLambdaAsCoroutine(e: Throwable? = null, x: (Continuation<String>) -> Any?): String {
|
||||||
var result = "fail"
|
var result = "fail"
|
||||||
@@ -69,7 +69,7 @@ fun runCustomLambdaAsCoroutine(e: Throwable? = null, x: (Continuation<String>) -
|
|||||||
fun box(): String {
|
fun box(): String {
|
||||||
val x = runCustomLambdaAsCoroutine {
|
val x = runCustomLambdaAsCoroutine {
|
||||||
it.resume("OK")
|
it.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
if (x != "OK") return "fail 1: $x"
|
if (x != "OK") return "fail 1: $x"
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(a: String = "abc", i: Int = 2): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(a: String = "abc", i: Int = 2): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(a + "#" + (i + 1))
|
x.resume(a + "#" + (i + 1))
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,13 +10,13 @@ class Controller {
|
|||||||
suspend fun <T> suspendWithValue(value: T): T = suspendCoroutineOrReturn { continuation ->
|
suspend fun <T> suspendWithValue(value: T): T = suspendCoroutineOrReturn { continuation ->
|
||||||
log += "suspend($value);"
|
log += "suspend($value);"
|
||||||
continuation.resume(value)
|
continuation.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun suspendWithException(value: String): Unit = suspendCoroutineOrReturn { continuation ->
|
suspend fun suspendWithException(value: String): Unit = suspendCoroutineOrReturn { continuation ->
|
||||||
log += "error($value);"
|
log += "error($value);"
|
||||||
continuation.resumeWithException(RuntimeException(value))
|
continuation.resumeWithException(RuntimeException(value))
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Controller {
|
|||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
result++
|
result++
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun <T> suspendHere(v: T): T = suspendCoroutineOrReturn { x ->
|
suspend fun <T> suspendHere(v: T): T = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -57,6 +57,6 @@ class GeneratedIterator<T>(block: suspend Generator<T>.() -> Unit) : AbstractIte
|
|||||||
setNext(value)
|
setNext(value)
|
||||||
nextStep = c
|
nextStep = c
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ class Controller {
|
|||||||
x.resume(v)
|
x.resume(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
||||||
@@ -20,7 +20,7 @@ class Controller {
|
|||||||
x.resumeWithException(e)
|
x.resumeWithException(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun run(c: suspend Controller.() -> Unit) {
|
fun run(c: suspend Controller.() -> Unit) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
fun builder(c: suspend () -> Unit) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Controller {
|
|||||||
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineOrReturn { x ->
|
suspend fun <T> suspendAndLog(value: T): T = suspendCoroutineOrReturn { x ->
|
||||||
log += "suspend($value);"
|
log += "suspend($value);"
|
||||||
x.resume(value)
|
x.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder1(c: suspend () -> Unit) {
|
fun builder1(c: suspend () -> Unit) {
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class Controller {
|
|||||||
|
|
||||||
suspend inline fun suspendInline(v: String): String = suspendCoroutineOrReturn { x ->
|
suspend inline fun suspendInline(v: String): String = suspendCoroutineOrReturn { x ->
|
||||||
withValue(v, x)
|
withValue(v, x)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend inline fun suspendInline(crossinline b: () -> String): String = suspendInline(b())
|
suspend inline fun suspendInline(crossinline b: () -> String): String = suspendInline(b())
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class Controller {
|
|||||||
x.resume(v)
|
x.resume(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
||||||
@@ -21,7 +21,7 @@ class Controller {
|
|||||||
x.resumeWithException(e)
|
x.resumeWithException(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun run(c: suspend Controller.() -> String) {
|
fun run(c: suspend Controller.() -> String) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class Controller {
|
|||||||
var i = 0
|
var i = 0
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume((i++).toString())
|
x.resume((i++).toString())
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ class Controller {
|
|||||||
suspend fun runInstanceOf(): Boolean = suspendCoroutineOrReturn { x ->
|
suspend fun runInstanceOf(): Boolean = suspendCoroutineOrReturn { x ->
|
||||||
val y: Any = x
|
val y: Any = x
|
||||||
x.resume(x is Continuation<*>)
|
x.resume(x is Continuation<*>)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun runCast(): Boolean = suspendCoroutineOrReturn { x ->
|
suspend fun runCast(): Boolean = suspendCoroutineOrReturn { x ->
|
||||||
val y: Any = x
|
val y: Any = x
|
||||||
x.resume(Continuation::class.isInstance(y as Continuation<*>))
|
x.resume(Continuation::class.isInstance(y as Continuation<*>))
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): Unit = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun <V> suspendHere(v: V): V = suspendCoroutineOrReturn { x ->
|
suspend fun <V> suspendHere(v: V): V = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> String): String {
|
fun builder(c: suspend () -> String): String {
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// WITH_COROUTINES
|
// WITH_COROUTINES
|
||||||
|
|
||||||
import kotlin.coroutines.experimental.intrinsics.SUSPENDED_MARKER
|
import kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED
|
||||||
import kotlin.coroutines.experimental.intrinsics.suspendCoroutineOrReturn
|
import kotlin.coroutines.experimental.intrinsics.suspendCoroutineOrReturn
|
||||||
import kotlin.coroutines.experimental.startCoroutine
|
import kotlin.coroutines.experimental.startCoroutine
|
||||||
|
|
||||||
@@ -24,7 +24,7 @@ class Foo(val value: Any) {
|
|||||||
|
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
fun builder(c: suspend () -> Unit) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Controller {
|
|||||||
suspend fun suspendHere(v: String): Unit = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(v: String): Unit = suspendCoroutineOrReturn { x ->
|
||||||
result += v
|
result += v
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
fun builder(c: suspend () -> Unit) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
fun builder(c: suspend () -> Unit) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Controller {
|
|||||||
suspend fun suspendHere(v: String): Unit = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(v: String): Unit = suspendCoroutineOrReturn { x ->
|
||||||
this.v = v
|
this.v = v
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// WITH_COROUTINES
|
// WITH_COROUTINES
|
||||||
import kotlin.coroutines.experimental.*
|
import kotlin.coroutines.experimental.*
|
||||||
import kotlin.coroutines.experimental.intrinsics.SUSPENDED_MARKER
|
import kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED
|
||||||
import kotlin.coroutines.experimental.intrinsics.suspendCoroutineOrReturn
|
import kotlin.coroutines.experimental.intrinsics.suspendCoroutineOrReturn
|
||||||
|
|
||||||
class OkDelegate {
|
class OkDelegate {
|
||||||
@@ -10,7 +10,7 @@ class OkDelegate {
|
|||||||
|
|
||||||
suspend fun <T> suspendWithValue(value: T): T = suspendCoroutineOrReturn { c ->
|
suspend fun <T> suspendWithValue(value: T): T = suspendCoroutineOrReturn { c ->
|
||||||
c.resume(value)
|
c.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun launch(c: suspend () -> String): String {
|
fun launch(c: suspend () -> String): String {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class Controller {
|
|||||||
var result = "fail"
|
var result = "fail"
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
lastSuspension = x
|
lastSuspension = x
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hasNext() = lastSuspension != null
|
fun hasNext() = lastSuspension != null
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ class Controller {
|
|||||||
var result = "fail"
|
var result = "fail"
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
lastSuspension = x
|
lastSuspension = x
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hasNext() = lastSuspension != null
|
fun hasNext() = lastSuspension != null
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ class Controller {
|
|||||||
var result = "fail"
|
var result = "fail"
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
lastSuspension = x
|
lastSuspension = x
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hasNext() = lastSuspension != null
|
fun hasNext() = lastSuspension != null
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ class Controller {
|
|||||||
var result = "fail"
|
var result = "fail"
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
lastSuspension = x
|
lastSuspension = x
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun hasNext() = lastSuspension != null
|
fun hasNext() = lastSuspension != null
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class Controller {
|
|||||||
x.resume(v)
|
x.resume(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
||||||
@@ -21,7 +21,7 @@ class Controller {
|
|||||||
x.resumeWithException(e)
|
x.resumeWithException(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun run(c: suspend Controller.() -> String) {
|
fun run(c: suspend Controller.() -> String) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class Controller {
|
|||||||
var cResult = 0
|
var cResult = 0
|
||||||
suspend fun suspendHere(v: Int): Int = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(v: Int): Int = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v * 2)
|
x.resume(v * 2)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ class Controller {
|
|||||||
var cResult = 0
|
var cResult = 0
|
||||||
suspend fun suspendHere(v: Int): Int = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(v: Int): Int = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v * 2)
|
x.resume(v * 2)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Int): Int {
|
fun builder(c: suspend () -> Int): Int {
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
fun builder(c: suspend () -> Unit) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resumeWithException(RuntimeException("OK"))
|
x.resumeWithException(RuntimeException("OK"))
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Int): Int {
|
fun builder(c: suspend () -> Int): Int {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
var globalResult = ""
|
var globalResult = ""
|
||||||
suspend fun suspendWithValue(v: String): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendWithValue(v: String): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> String) {
|
fun builder(c: suspend () -> String) {
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
interface TestInterface {
|
interface TestInterface {
|
||||||
suspend fun toInt(): Int = suspendCoroutineOrReturn { x ->
|
suspend fun toInt(): Int = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(56)
|
x.resume(56)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ class Controller {
|
|||||||
|
|
||||||
suspend fun suspendThere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendThere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(v: Int): Int = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(v: Int): Int = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v * 2)
|
x.resume(v * 2)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
object Host {
|
object Host {
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -11,13 +11,13 @@ class Controller {
|
|||||||
suspend fun <T> suspendWithValue(value: T): T = suspendCoroutineOrReturn { continuation ->
|
suspend fun <T> suspendWithValue(value: T): T = suspendCoroutineOrReturn { continuation ->
|
||||||
log += "suspend($value);"
|
log += "suspend($value);"
|
||||||
continuation.resume(value)
|
continuation.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun suspendWithException(value: String): Unit = suspendCoroutineOrReturn { continuation ->
|
suspend fun suspendWithException(value: String): Unit = suspendCoroutineOrReturn { continuation ->
|
||||||
log += "error($value);"
|
log += "error($value);"
|
||||||
continuation.resumeWithException(RuntimeException(value))
|
continuation.resumeWithException(RuntimeException(value))
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -12,7 +12,7 @@ class Controller {
|
|||||||
x.resume(v)
|
x.resume(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
||||||
@@ -20,7 +20,7 @@ class Controller {
|
|||||||
x.resumeWithException(e)
|
x.resumeWithException(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun run(c: suspend Controller.() -> Unit) {
|
fun run(c: suspend Controller.() -> Unit) {
|
||||||
@@ -50,7 +50,7 @@ fun commonThrow(t: Throwable) {
|
|||||||
suspend fun justContinue(): Unit = suspendCoroutineOrReturn { x ->
|
suspend fun justContinue(): Unit = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun Controller.test1() {
|
suspend fun Controller.test1() {
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend inline fun suspendHere(crossinline block: () -> String): String {
|
suspend inline fun suspendHere(crossinline block: () -> String): String {
|
||||||
|
|||||||
+2
-2
@@ -2,13 +2,13 @@
|
|||||||
// WITH_COROUTINES
|
// WITH_COROUTINES
|
||||||
// TARGET_BACKEND: JVM
|
// TARGET_BACKEND: JVM
|
||||||
import kotlin.coroutines.experimental.*
|
import kotlin.coroutines.experimental.*
|
||||||
import kotlin.coroutines.experimental.intrinsics.SUSPENDED_MARKER
|
import kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED
|
||||||
import kotlin.coroutines.experimental.intrinsics.suspendCoroutineOrReturn
|
import kotlin.coroutines.experimental.intrinsics.suspendCoroutineOrReturn
|
||||||
|
|
||||||
class MyTest {
|
class MyTest {
|
||||||
suspend fun act(value: String): String = suspendCoroutineOrReturn {
|
suspend fun act(value: String): String = suspendCoroutineOrReturn {
|
||||||
it.resume(value)
|
it.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class A(val v: String) {
|
class A(val v: String) {
|
||||||
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun suspendHere(): String = suspendThere("O") + suspendThere(v)
|
suspend fun suspendHere(): String = suspendThere("O") + suspendThere(v)
|
||||||
|
|||||||
Vendored
+2
-2
@@ -1,13 +1,13 @@
|
|||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// WITH_COROUTINES
|
// WITH_COROUTINES
|
||||||
import kotlin.coroutines.experimental.*
|
import kotlin.coroutines.experimental.*
|
||||||
import kotlin.coroutines.experimental.intrinsics.SUSPENDED_MARKER
|
import kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED
|
||||||
import kotlin.coroutines.experimental.intrinsics.suspendCoroutineOrReturn
|
import kotlin.coroutines.experimental.intrinsics.suspendCoroutineOrReturn
|
||||||
|
|
||||||
class MyTest {
|
class MyTest {
|
||||||
suspend fun act(value: String): String = suspendCoroutineOrReturn {
|
suspend fun act(value: String): String = suspendCoroutineOrReturn {
|
||||||
it.resume(value)
|
it.resume(value)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -7,7 +7,7 @@ import kotlin.reflect.KProperty
|
|||||||
|
|
||||||
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
class A(val x: String) {
|
class A(val x: String) {
|
||||||
@@ -21,13 +21,13 @@ class A(val x: String) {
|
|||||||
if (value != "56") return@suspendCoroutineOrReturn Unit
|
if (value != "56") return@suspendCoroutineOrReturn Unit
|
||||||
isSetValueCalled = true
|
isSetValueCalled = true
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
operator suspend fun provideDelegate(host: Any?, p: Any): A = suspendCoroutineOrReturn { x ->
|
operator suspend fun provideDelegate(host: Any?, p: Any): A = suspendCoroutineOrReturn { x ->
|
||||||
isProvideDelegateCalled = true
|
isProvideDelegateCalled = true
|
||||||
x.resume(this)
|
x.resume(this)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
operator suspend fun plus(y: String) = suspendThere(x + y)
|
operator suspend fun plus(y: String) = suspendThere(x + y)
|
||||||
@@ -36,14 +36,14 @@ class A(val x: String) {
|
|||||||
operator suspend fun inc(): A = suspendCoroutineOrReturn { x ->
|
operator suspend fun inc(): A = suspendCoroutineOrReturn { x ->
|
||||||
isProvideDelegateCalled = true
|
isProvideDelegateCalled = true
|
||||||
x.resume(this)
|
x.resume(this)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
operator suspend fun minusAssign(y: String): Unit = suspendCoroutineOrReturn { x ->
|
operator suspend fun minusAssign(y: String): Unit = suspendCoroutineOrReturn { x ->
|
||||||
if (y != "56") return@suspendCoroutineOrReturn Unit
|
if (y != "56") return@suspendCoroutineOrReturn Unit
|
||||||
isMinusAssignCalled = true
|
isMinusAssignCalled = true
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -23,7 +23,7 @@ class X {
|
|||||||
|
|
||||||
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend X.() -> Unit) {
|
fun builder(c: suspend X.() -> Unit) {
|
||||||
|
|||||||
+1
-1
@@ -9,7 +9,7 @@ private suspend fun foo(): String {
|
|||||||
if (x) {
|
if (x) {
|
||||||
return suspendCoroutineOrReturn<String> {
|
return suspendCoroutineOrReturn<String> {
|
||||||
it.resume("OK")
|
it.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun suspendHere(suspend: Boolean): String {
|
suspend fun suspendHere(suspend: Boolean): String {
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun suspendHere(): String = suspendThere("O") + suspendThere("K")
|
suspend fun suspendHere(): String = suspendThere("O") + suspendThere("K")
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendThere(v: String): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun suspendHere(): String {
|
suspend fun suspendHere(): String {
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendHere(v: String): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(v: String): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
fun builder(c: suspend () -> Unit) {
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendHere(v: String): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(v: String): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
fun builder(c: suspend () -> Unit) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendHere(v: String): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(v: String): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
fun builder(c: suspend () -> Unit) {
|
||||||
|
|||||||
@@ -7,11 +7,11 @@ class Controller {
|
|||||||
var i = 0
|
var i = 0
|
||||||
suspend fun suspendHere(): Int = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): Int = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(i++)
|
x.resume(i++)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
suspend fun suspendThere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendThere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("?")
|
x.resume("?")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -6,17 +6,17 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("K")
|
x.resume("K")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun suspendWithArgument(v: String): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendWithArgument(v: String): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun suspendWithDouble(v: Double): Double = suspendCoroutineOrReturn { x ->
|
suspend fun suspendWithDouble(v: Double): Double = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class TestClass {
|
class TestClass {
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("K")
|
x.resume("K")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class TestClass {
|
class TestClass {
|
||||||
suspend fun toInt(): Int = suspendCoroutineOrReturn { x ->
|
suspend fun toInt(): Int = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(14)
|
x.resume(14)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ suspend fun foo(x: Any): Int {
|
|||||||
|
|
||||||
suspend fun suspendHere(): Int = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): Int = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(56)
|
x.resume(56)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
fun builder(c: suspend () -> Unit) {
|
||||||
|
|||||||
+1
-1
@@ -13,7 +13,7 @@ suspend fun foo(x: Any): Int {
|
|||||||
|
|
||||||
suspend fun suspendHere(): Int = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): Int = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(56)
|
x.resume(56)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
fun builder(c: suspend () -> Unit) {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ suspend fun foo(x: Any): Int {
|
|||||||
|
|
||||||
suspend fun suspendHere(): Int = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): Int = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(56)
|
x.resume(56)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
fun builder(c: suspend () -> Unit) {
|
||||||
|
|||||||
+2
-2
@@ -13,7 +13,7 @@ class Controller {
|
|||||||
x.resume(v)
|
x.resume(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
||||||
@@ -21,7 +21,7 @@ class Controller {
|
|||||||
x.resumeWithException(e)
|
x.resumeWithException(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun run(c: suspend Controller.() -> String) {
|
fun run(c: suspend Controller.() -> String) {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class Controller {
|
|||||||
x.resume(v)
|
x.resume(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
||||||
@@ -21,7 +21,7 @@ class Controller {
|
|||||||
x.resumeWithException(e)
|
x.resumeWithException(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun run(c: suspend Controller.() -> String) {
|
fun run(c: suspend Controller.() -> String) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ class Controller {
|
|||||||
suspend fun suspendHere(v: String): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(v: String): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume(v)
|
x.resume(v)
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ class Controller {
|
|||||||
x.resume(v)
|
x.resume(v)
|
||||||
}
|
}
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendWithException(e: Exception): String = suspendCoroutineOrReturn { x ->
|
||||||
@@ -21,7 +21,7 @@ class Controller {
|
|||||||
x.resumeWithException(e)
|
x.resumeWithException(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun run(c: suspend Controller.() -> String) {
|
fun run(c: suspend Controller.() -> String) {
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
fun builder(c: suspend () -> Unit) {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
|
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
|
|
||||||
fun builder(c: suspend () -> Unit) {
|
fun builder(c: suspend () -> Unit) {
|
||||||
|
|||||||
+1
-1
@@ -16,7 +16,7 @@ suspend fun suspendHere(x: Int): Unit {
|
|||||||
result = "OK"
|
result = "OK"
|
||||||
return suspendCoroutineOrReturn { x ->
|
return suspendCoroutineOrReturn { x ->
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ suspend fun suspendHere(x: Int): Unit {
|
|||||||
result = "OK"
|
result = "OK"
|
||||||
return suspendCoroutineOrReturn { x ->
|
return suspendCoroutineOrReturn { x ->
|
||||||
x.resume(Unit)
|
x.resume(Unit)
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
COROUTINE_SUSPENDED
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import kotlin.coroutines.experimental.intrinsics.*
|
|||||||
class Controller {
|
class Controller {
|
||||||
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
suspend fun suspendHere(): String = suspendCoroutineOrReturn { x ->
|
||||||
x.resume("OK")
|
x.resume("OK")
|
||||||
SUSPENDED_MARKER
|
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