Quick-fix to add 'suspend' to the receiver of startCoroutine / createCoroutine #KT-15738 Fixed
This commit is contained in:
committed by
mglukhikh
parent
5f455bbe3a
commit
9fdf16e5d7
@@ -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) }
|
||||
Reference in New Issue
Block a user