mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-03-10 08:31:29 +00:00
Migrate tests to release coroutines
where it's not essential to use experimental ones #KT-36083
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
package test
|
||||
import kotlin.coroutines.experimental.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
data class Modifiers(val x: Int) {
|
||||
external fun extFun()
|
||||
|
||||
@@ -139,10 +139,8 @@ PsiJetFileStubImpl[package=test]
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
USER_TYPE
|
||||
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||
REFERENCE_EXPRESSION[referencedName=coroutines]
|
||||
REFERENCE_EXPRESSION[referencedName=experimental]
|
||||
REFERENCE_EXPRESSION[referencedName=kotlin]
|
||||
REFERENCE_EXPRESSION[referencedName=coroutines]
|
||||
REFERENCE_EXPRESSION[referencedName=Continuation]
|
||||
TYPE_ARGUMENT_LIST
|
||||
TYPE_PROJECTION[projectionKind=NONE]
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
@@ -1,18 +1,16 @@
|
||||
package usage
|
||||
import kotlin.coroutines.experimental.*
|
||||
import kotlin.coroutines.experimental.intrinsics.*
|
||||
import kotlin.coroutines.*
|
||||
import kotlin.coroutines.intrinsics.*
|
||||
|
||||
fun async(x: suspend Controller.() -> Unit) {
|
||||
x.startCoroutine(Controller(), object : Continuation<Unit> {
|
||||
override val context: CoroutineContext = null!!
|
||||
override fun resume(value: Unit) {}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {}
|
||||
override fun resumeWith(result: Result<Unit>) {}
|
||||
})
|
||||
}
|
||||
|
||||
class Controller {
|
||||
suspend fun step(param: Int) = suspendCoroutineOrReturn<Int> { next ->
|
||||
suspend fun step(param: Int) = suspendCoroutineUninterceptedOrReturn<Int> { next ->
|
||||
next.resume(param + 1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user