Minor. Throw exceptions in test coroutine builders
This commit is contained in:
+3
-1
@@ -19,7 +19,9 @@ import kotlin.coroutines.*
|
||||
import test.*
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext) {})
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext) {
|
||||
it.getOrThrow()
|
||||
})
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+3
-1
@@ -6,7 +6,9 @@ import kotlin.coroutines.*
|
||||
fun box(): String = a { (::write)() }
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext) {})
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext) {
|
||||
it.getOrThrow()
|
||||
})
|
||||
}
|
||||
|
||||
fun a(a: suspend Writer.() -> String): String {
|
||||
|
||||
+3
-1
@@ -14,7 +14,9 @@ actual suspend fun withLimit(limit: Long) {
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext) {})
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext) {
|
||||
it.getOrThrow()
|
||||
})
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -18,7 +18,9 @@ suspend fun whatever() = coroutineScope {
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext) {})
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext) {
|
||||
it.getOrThrow()
|
||||
})
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -17,7 +17,9 @@ class C {
|
||||
}
|
||||
|
||||
fun <T : Any> df(t: T, r: suspend (T) -> Unit) {
|
||||
r.startCoroutine(t, Continuation(EmptyCoroutineContext) {})
|
||||
r.startCoroutine(t, Continuation(EmptyCoroutineContext) {
|
||||
it.getOrThrow()
|
||||
})
|
||||
}
|
||||
|
||||
fun foo(s: String, c: C?) {
|
||||
|
||||
Vendored
+3
-1
@@ -16,7 +16,9 @@ suspend fun returnsUnboxed() = InlineClass("")
|
||||
suspend fun test(): String = returnsUnboxed().ok()
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext) {})
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext) {
|
||||
it.getOrThrow()
|
||||
})
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
+3
-1
@@ -994,7 +994,9 @@ suspend fun test() {
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext) {})
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext) {
|
||||
it.getOrThrow()
|
||||
})
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
@@ -9,7 +9,9 @@ import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
fun runBlocking(c: suspend () -> Unit) {
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext){})
|
||||
c.startCoroutine(Continuation(EmptyCoroutineContext){
|
||||
it.getOrThrow()
|
||||
})
|
||||
}
|
||||
|
||||
inline fun <reified E> foo(noinline block: (String) -> Unit) = runBlocking {
|
||||
|
||||
Reference in New Issue
Block a user