Quick-fix to add 'suspend' to the receiver of startCoroutine / createCoroutine #KT-15738 Fixed

This commit is contained in:
Mikhail Glukhikh
2017-01-20 16:37:11 +03:00
committed by mglukhikh
parent 5f455bbe3a
commit 9fdf16e5d7
9 changed files with 103 additions and 3 deletions
@@ -0,0 +1,10 @@
// "Make block type suspend" "true"
// WITH_RUNTIME
import kotlin.coroutines.suspendCoroutine
import kotlin.coroutines.createCoroutine
suspend fun <T> suspending(): T {
val block: () -> T = { null!! }
return suspendCoroutine { block.<caret>createCoroutine(it) }
}
@@ -0,0 +1,10 @@
// "Make block type suspend" "true"
// WITH_RUNTIME
import kotlin.coroutines.suspendCoroutine
import kotlin.coroutines.createCoroutine
suspend fun <T> suspending(): T {
val block: suspend () -> T = { null!! }
return suspendCoroutine { block.createCoroutine(it) }
}
@@ -0,0 +1,7 @@
// "Make block type suspend" "true"
// WITH_RUNTIME
import kotlin.coroutines.suspendCoroutine
import kotlin.coroutines.startCoroutine
suspend fun <T> suspending(block: () -> T): T = suspendCoroutine { block.<caret>startCoroutine(it) }
@@ -0,0 +1,7 @@
// "Make block type suspend" "true"
// WITH_RUNTIME
import kotlin.coroutines.suspendCoroutine
import kotlin.coroutines.startCoroutine
suspend fun <T> suspending(block: suspend () -> T): T = suspendCoroutine { block.startCoroutine(it) }
@@ -0,0 +1,7 @@
// "Make block type suspend" "true"
// WITH_RUNTIME
// DISABLE-ERRORS
import kotlin.coroutines.suspendCoroutine
suspend fun <T> suspending(block: () -> T): T = suspendCoroutine { block.<caret>startCoroutine(it) }
@@ -0,0 +1,7 @@
// "Make block type suspend" "true"
// WITH_RUNTIME
// DISABLE-ERRORS
import kotlin.coroutines.suspendCoroutine
suspend fun <T> suspending(block: suspend () -> T): T = suspendCoroutine { block.startCoroutine(it) }