Move coroutine intrinsics to kotlin.coroutine.intrinsics package
Also rename val SUSPENDED to SUSPENDED_MARKER
#KT-15698 Fixed
Original commit: 2cb9d3a8ad
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
package usage
|
package usage
|
||||||
import kotlin.coroutines.*
|
import kotlin.coroutines.*
|
||||||
|
import kotlin.coroutines.intrinsics.*
|
||||||
|
|
||||||
fun async(x: suspend Controller.() -> Unit) {
|
fun async(x: suspend Controller.() -> Unit) {
|
||||||
x.startCoroutine(Controller(), object : Continuation<Unit> {
|
x.startCoroutine(Controller(), object : Continuation<Unit> {
|
||||||
@@ -10,7 +11,7 @@ fun async(x: suspend Controller.() -> Unit) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class Controller {
|
class Controller {
|
||||||
suspend fun step(param: Int) = CoroutineIntrinsics.suspendCoroutineOrReturn<Int> { next ->
|
suspend fun step(param: Int) = suspendCoroutineOrReturn<Int> { next ->
|
||||||
next.resume(param + 1)
|
next.resume(param + 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user