JVM IR: Remove remains of 1.2 coroutines from tests

Remove CoroutineAdapter and LANGUAGE: +ReleaseContinuation,
which are meaninless now.
Update the tests accordingly.
This commit is contained in:
Ilmir Usmanov
2023-02-03 04:33:50 +01:00
committed by Space Team
parent ebc4cf7f96
commit d7fd2471b8
47 changed files with 159 additions and 319 deletions
@@ -32,17 +32,3 @@ class ResultContinuation : Continuation<Any?> {
var result: Any? = null
}
abstract class ContinuationAdapter<in T> : Continuation<T> {
override val context: CoroutineContext = EmptyCoroutineContext
override fun resumeWith(result: Result<T>) {
if (result.isSuccess) {
resume(result.getOrThrow())
} else {
resumeWithException(result.exceptionOrNull()!!)
}
}
abstract fun resumeWithException(exception: Throwable)
abstract fun resume(value: T)
}
@@ -3,19 +3,17 @@ package helpers
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
val StateMachineChecker = StateMachineCheckerClass()
object CheckStateMachineContinuation: ContinuationAdapter<Unit>() {
object CheckStateMachineContinuation: Continuation<Unit> {
override val context: CoroutineContext
get() = EmptyCoroutineContext
override fun resume(value: Unit) {
override fun resumeWith(value: Result<Unit>) {
value.getOrThrow()
StateMachineChecker.proceed = {
StateMachineChecker.finished = true
}
}
override fun resumeWithException(exception: Throwable) {
throw exception
}
}
}
@@ -1,6 +1,5 @@
// FIR_IDENTICAL
// !CHECK_TYPE
// !LANGUAGE: +ReleaseCoroutines
// SKIP_TXT
import kotlin.reflect.KSuspendFunction0
@@ -1,5 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ReleaseCoroutines
// !DIAGNOSTICS: -UNUSED_VARIABLE
suspend fun foo() {}
@@ -1,5 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ReleaseCoroutines
// SKIP_TXT
fun <R> suspend(block: suspend () -> R): suspend () -> R = block
@@ -1,5 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ReleaseCoroutines
// SKIP_TXT
fun <R> suspend(block: R) = block
@@ -1,5 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ReleaseCoroutines
// SKIP_TXT
fun bar() {
@@ -1,4 +1,3 @@
// !LANGUAGE: +ReleaseCoroutines
// SKIP_TXT
import kotlin.suspend as suspendLambda
@@ -1,4 +1,3 @@
// !LANGUAGE: +ReleaseCoroutines
// SKIP_TXT
import kotlin.suspend as suspendLambda
@@ -1,5 +1,4 @@
// FIR_IDENTICAL
// !LANGUAGE: +ReleaseCoroutines
// SKIP_TXT
suspend fun test() {
@@ -1,5 +1,5 @@
// FIR_IDENTICAL
// !LANGUAGE: +ReleaseCoroutines +ExperimentalBuilderInference
// !LANGUAGE: +ExperimentalBuilderInference
// !OPT_IN: kotlin.RequiresOptIn
// SKIP_TXT