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
@@ -23,20 +23,6 @@ fun createTextForCoroutineHelpers(checkStateMachine: Boolean, checkTailCallOptim
|}
""".trimMargin()
val continuationAdapterBody =
"""
|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)
""".trimMargin()
val checkStateMachineString = """
class StateMachineCheckerClass {
private var counter = 0
@@ -68,19 +54,16 @@ fun createTextForCoroutineHelpers(checkStateMachine: Boolean, checkTailCallOptim
}
}
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
}
}
""".trimIndent()
@@ -146,11 +129,6 @@ fun createTextForCoroutineHelpers(checkStateMachine: Boolean, checkTailCallOptim
| var result: Any? = null
|}
|
|abstract class ContinuationAdapter<in T> : Continuation<T> {
| override val context: CoroutineContext = EmptyCoroutineContext
| $continuationAdapterBody
|}
|
|${if (checkStateMachine) checkStateMachineString else ""}
|${if (checkTailCallOptimization) checkTailCallOptimizationString else ""}
""".trimMargin()