Replace @Suspend to suspend in box tests.
This commit is contained in:
+1
-1
@@ -73,7 +73,7 @@ suspend fun <S> awaitAndLog(value: Promise<S>): S {
|
||||
})
|
||||
}
|
||||
|
||||
fun <T> async(c: @Suspend() (() -> T)): Promise<T> {
|
||||
fun <T> async(c: suspend () -> T): Promise<T> {
|
||||
return Promise { resolve ->
|
||||
c.startCoroutine(handleResultContinuation(resolve))
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
suspend fun suspendHere(): Any = suspendWithCurrentContinuation { x -> }
|
||||
|
||||
fun builder(c: @Suspend() (() -> Unit)) {
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
var exception: Throwable? = null
|
||||
|
||||
c.createCoroutine(object : Continuation<Unit> {
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
// WITH_COROUTINES
|
||||
suspend fun suspendHere(): Any = suspendWithCurrentContinuation { x ->}
|
||||
|
||||
fun builder(c: @Suspend() (() -> Unit)) {
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
try {
|
||||
c.createCoroutine(EmptyContinuation).resumeWithException(RuntimeException("OK"))
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ suspend fun <T> await(t: T): T = suspendWithCurrentContinuation { c ->
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (() -> Unit)): String {
|
||||
fun builder(c: suspend () -> Unit): String {
|
||||
var result = "fail"
|
||||
c.startCoroutine(handleResultContinuation {
|
||||
result = "OK"
|
||||
|
||||
@@ -10,7 +10,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)): String {
|
||||
fun builder(c: suspend Controller.() -> Unit): String {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, EmptyContinuation)
|
||||
return controller.result
|
||||
|
||||
@@ -10,7 +10,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)): String {
|
||||
fun builder(c: suspend Controller.() -> Unit): String {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, EmptyContinuation)
|
||||
return controller.result
|
||||
|
||||
@@ -10,7 +10,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)): String {
|
||||
fun builder(c: suspend Controller.() -> Unit): String {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, EmptyContinuation)
|
||||
return controller.result
|
||||
|
||||
@@ -10,7 +10,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)): String {
|
||||
fun builder(c: suspend Controller.() -> Unit): String {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, EmptyContinuation)
|
||||
return controller.result
|
||||
|
||||
@@ -10,7 +10,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)): String {
|
||||
fun builder(c: suspend Controller.() -> Unit): String {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, EmptyContinuation)
|
||||
return controller.result
|
||||
|
||||
@@ -10,7 +10,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)): String {
|
||||
fun builder(c: suspend Controller.() -> Unit): String {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, EmptyContinuation)
|
||||
return controller.result
|
||||
|
||||
@@ -11,7 +11,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)): String {
|
||||
fun builder(c: suspend Controller.() -> Unit): String {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, EmptyContinuation)
|
||||
return controller.result
|
||||
|
||||
@@ -18,7 +18,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)): String {
|
||||
fun builder(c: suspend Controller.() -> Unit): String {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, object : Continuation<Unit> {
|
||||
override fun resume(data: Unit) {
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)): String {
|
||||
fun builder(c: suspend Controller.() -> Unit): String {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, object : Continuation<Unit> {
|
||||
override fun resume(data: Unit) {}
|
||||
|
||||
@@ -10,7 +10,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)): String {
|
||||
fun builder(c: suspend Controller.() -> Unit): String {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, EmptyContinuation)
|
||||
return controller.result
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, EmptyContinuation)
|
||||
if (!controller.result) throw RuntimeException("fail")
|
||||
|
||||
@@ -9,7 +9,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ class Controller {
|
||||
}
|
||||
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
+3
-3
@@ -29,13 +29,13 @@ interface Generator<in T> {
|
||||
suspend fun yield(value: T)
|
||||
}
|
||||
|
||||
fun <T> generate(block: @Suspend() (Generator<T>.() -> Unit)): Sequence<T> = GeneratedSequence(block)
|
||||
fun <T> generate(block: suspend Generator<T>.() -> Unit): Sequence<T> = GeneratedSequence(block)
|
||||
|
||||
class GeneratedSequence<out T>(private val block: @Suspend() (Generator<T>.() -> Unit)) : Sequence<T> {
|
||||
class GeneratedSequence<out T>(private val block: suspend Generator<T>.() -> Unit) : Sequence<T> {
|
||||
override fun iterator(): Iterator<T> = GeneratedIterator(block)
|
||||
}
|
||||
|
||||
class GeneratedIterator<T>(block: @Suspend() (Generator<T>.() -> Unit)) : AbstractIterator<T>(), Generator<T> {
|
||||
class GeneratedIterator<T>(block: suspend Generator<T>.() -> Unit) : AbstractIterator<T>(), Generator<T> {
|
||||
private var nextStep: Continuation<Unit> = block.createCoroutine(this, object : Continuation<Unit> {
|
||||
override fun resume(data: Unit) {
|
||||
done()
|
||||
|
||||
@@ -20,7 +20,7 @@ class Controller {
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun run(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun run(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(this, handleExceptionContinuation {
|
||||
exception = it
|
||||
})
|
||||
@@ -31,7 +31,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
val controller = Controller()
|
||||
controller.run(c)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
fun builder(c: @Suspend() (() -> Unit)): String {
|
||||
fun builder(c: suspend () -> Unit): String {
|
||||
var ok = false
|
||||
c.startCoroutine(handleResultContinuation {
|
||||
ok = true
|
||||
|
||||
@@ -6,7 +6,7 @@ suspend fun suspendHere(): String = suspendWithCurrentContinuation { x ->
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (() -> Unit)) {
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
var isCompleted = false
|
||||
c.startCoroutine(handleResultContinuation {
|
||||
isCompleted = true
|
||||
|
||||
@@ -10,7 +10,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> String)): String {
|
||||
fun builder(c: suspend Controller.() -> String): String {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, handleResultContinuation {
|
||||
controller.log += "return($it);"
|
||||
|
||||
@@ -7,11 +7,11 @@ suspend fun suspendHere(): Unit = suspendWithCurrentContinuation { x ->
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun builder1(c: @Suspend() (() -> Unit)) {
|
||||
fun builder1(c: suspend () -> Unit) {
|
||||
(c as Continuation<Unit>).resume(Unit)
|
||||
}
|
||||
|
||||
fun builder2(c: @Suspend() (() -> Unit)) {
|
||||
fun builder2(c: suspend () -> Unit) {
|
||||
val continuation = c.createCoroutine(EmptyContinuation)
|
||||
val declaredField = continuation.javaClass.superclass.superclass.getDeclaredField("label")
|
||||
declaredField.setAccessible(true)
|
||||
|
||||
@@ -21,7 +21,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class Controller {
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun run(c: @Suspend() (Controller.() -> String)) {
|
||||
fun run(c: suspend Controller.() -> String) {
|
||||
c.startCoroutine(this, handleResultContinuation {
|
||||
globalResult = it
|
||||
})
|
||||
@@ -32,7 +32,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(expectException: Boolean = false, c: @Suspend() (Controller.() -> String)) {
|
||||
fun builder(expectException: Boolean = false, c: suspend Controller.() -> String) {
|
||||
val controller = Controller()
|
||||
|
||||
globalResult = "#"
|
||||
|
||||
@@ -10,7 +10,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun test(c: @Suspend() (Controller.() -> Unit)): String {
|
||||
fun test(c: suspend Controller.() -> Unit): String {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, EmptyContinuation, object: ResumeInterceptor {
|
||||
private fun interceptResume(block: () -> Unit) {
|
||||
|
||||
@@ -9,7 +9,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ suspend fun <V> suspendHere(v: V): V = suspendWithCurrentContinuation { x ->
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (() -> String)): String {
|
||||
fun builder(c: suspend () -> String): String {
|
||||
var result = "fail"
|
||||
c.startCoroutine(handleResultContinuation {
|
||||
result = it
|
||||
|
||||
@@ -10,7 +10,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)): String {
|
||||
fun builder(c: suspend Controller.() -> Unit): String {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, handleResultContinuation {
|
||||
controller.ok = true
|
||||
|
||||
@@ -5,7 +5,7 @@ suspend fun suspendHere(): String = suspendWithCurrentContinuation { x ->
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (() -> Unit)) {
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
var wasHandleResultCalled = false
|
||||
c.startCoroutine(handleResultContinuation {
|
||||
wasHandleResultCalled = true
|
||||
|
||||
@@ -5,7 +5,7 @@ suspend fun suspendHere(): String = suspendWithCurrentContinuation { x ->
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (() -> Unit)) {
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
var wasHandleResultCalled = false
|
||||
c.startCoroutine(handleResultContinuation {
|
||||
wasHandleResultCalled = true
|
||||
|
||||
@@ -10,7 +10,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)): String {
|
||||
fun builder(c: suspend Controller.() -> Unit): String {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, handleResultContinuation {
|
||||
controller.ok = true
|
||||
|
||||
@@ -17,7 +17,7 @@ class Controller {
|
||||
// FILE: main.kt
|
||||
import lib.*
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ suspend fun Controller.localSuspendExtension(v: String) = v.suspendHere()
|
||||
|
||||
inline suspend fun Controller.localInlineSuspendExtension(v: String) = v.inlineSuspendHere()
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
val controller1 = Controller()
|
||||
val controller2 = Controller()
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
val controller1 = Controller()
|
||||
val controller2 = Controller()
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
val controller1 = Controller()
|
||||
val controller2 = Controller()
|
||||
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
val controller1 = Controller()
|
||||
val controller2 = Controller()
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class Controller {
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun run(c: @Suspend() (Controller.() -> String)) {
|
||||
fun run(c: suspend Controller.() -> String) {
|
||||
c.startCoroutine(this, handleResultContinuation {
|
||||
globalResult = it
|
||||
})
|
||||
@@ -34,7 +34,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(expectException: Boolean = false, c: @Suspend() (Controller.() -> String)) {
|
||||
fun builder(expectException: Boolean = false, c: suspend Controller.() -> String) {
|
||||
val controller = Controller()
|
||||
|
||||
globalResult = "#"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
fun builder(c: @Suspend() (() -> Int)): Int {
|
||||
fun builder(c: suspend () -> Int): Int {
|
||||
var res = 0
|
||||
c.startCoroutine(handleResultContinuation {
|
||||
res = it
|
||||
|
||||
@@ -8,7 +8,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Int)): Controller {
|
||||
fun builder(c: suspend Controller.() -> Int): Controller {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, handleResultContinuation {
|
||||
controller.cResult = it
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Int)): Controller {
|
||||
fun builder(c: suspend Controller.() -> Int): Controller {
|
||||
val controller = Controller()
|
||||
c.startCoroutine(controller, handleResultContinuation {
|
||||
controller.cResult = it
|
||||
|
||||
@@ -5,7 +5,7 @@ suspend fun suspendHere(): String = suspendWithCurrentContinuation { x ->
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (() -> Int)): Int {
|
||||
fun builder(c: suspend () -> Int): Int {
|
||||
var res = 0
|
||||
c.startCoroutine(handleResultContinuation {
|
||||
res = it
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ suspend fun suspendHere(): String = suspendWithCurrentContinuation { x ->
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() () -> Unit) {
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ suspend fun suspendHere(): String = suspendWithCurrentContinuation { x ->
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() () -> Int): Int {
|
||||
fun builder(c: suspend () -> Int): Int {
|
||||
var res = 0
|
||||
|
||||
c.createCoroutine(object : Continuation<Int> {
|
||||
|
||||
@@ -6,7 +6,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ suspend fun suspendWithValue(v: String): String = suspendWithCurrentContinuation
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (() -> String)) {
|
||||
fun builder(c: suspend () -> String) {
|
||||
c.startCoroutine(handleResultContinuation {
|
||||
globalResult = it
|
||||
})
|
||||
|
||||
@@ -11,7 +11,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ suspend fun Controller.suspendExtension(v: String): String = v.suspendHere()
|
||||
|
||||
inline suspend fun Controller.inlineSuspendExtension(v: String): String = v.inlineSuspendHere()
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -19,7 +19,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -21,7 +21,7 @@ class Controller {
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun run(c: @Suspend() (Controller.() -> String)) {
|
||||
fun run(c: suspend Controller.() -> String) {
|
||||
c.startCoroutine(this, handleResultContinuation {
|
||||
globalResult = it
|
||||
})
|
||||
@@ -34,7 +34,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(expectException: Boolean = false, c: @Suspend() (Controller.() -> String)) {
|
||||
fun builder(expectException: Boolean = false, c: suspend Controller.() -> String) {
|
||||
val controller = Controller()
|
||||
|
||||
globalResult = "#"
|
||||
|
||||
@@ -21,7 +21,7 @@ class Controller {
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun run(c: @Suspend() (Controller.() -> String)) {
|
||||
fun run(c: suspend Controller.() -> String) {
|
||||
c.startCoroutine(this, handleResultContinuation {
|
||||
globalResult = it
|
||||
})
|
||||
@@ -32,7 +32,7 @@ class Controller {
|
||||
}
|
||||
}
|
||||
|
||||
fun builder(expectException: Boolean = false, c: @Suspend() (Controller.() -> String)) {
|
||||
fun builder(expectException: Boolean = false, c: suspend Controller.() -> String) {
|
||||
val controller = Controller()
|
||||
|
||||
globalResult = "#"
|
||||
|
||||
@@ -10,7 +10,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class Controller {
|
||||
SUSPENDED
|
||||
}
|
||||
|
||||
fun run(c: @Suspend() (Controller.() -> String)) {
|
||||
fun run(c: suspend Controller.() -> String) {
|
||||
c.startCoroutine(this, handleResultContinuation {
|
||||
globalResult = it
|
||||
})
|
||||
@@ -34,7 +34,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(expectException: Boolean = false, c: @Suspend() (Controller.() -> String)) {
|
||||
fun builder(expectException: Boolean = false, c: suspend Controller.() -> String) {
|
||||
val controller = Controller()
|
||||
|
||||
globalResult = "#"
|
||||
|
||||
@@ -9,7 +9,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -9,7 +9,7 @@ class Controller {
|
||||
// INTERCEPT_RESUME_PLACEHOLDER
|
||||
}
|
||||
|
||||
fun builder(c: @Suspend() (Controller.() -> Unit)) {
|
||||
fun builder(c: suspend Controller.() -> Unit) {
|
||||
c.startCoroutine(Controller(), EmptyContinuation)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user