diff --git a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorNullMerge_1_2.kt b/compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorNullMerge_1_2.kt deleted file mode 100644 index bd917f779b0..00000000000 --- a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorNullMerge_1_2.kt +++ /dev/null @@ -1,142 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -ExperimentalBuilderInference -// IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS -// WITH_RUNTIME -// WITH_COROUTINES -// DONT_TARGET_EXACT_BACKEND: JS_IR -// DONT_TARGET_EXACT_BACKEND: JS_IR_ES6 - -import helpers.* -import kotlin.coroutines.experimental.* -import kotlin.coroutines.experimental.intrinsics.* - -interface AsyncGenerator { - suspend fun yield(value: T) -} - -interface AsyncSequence { - operator fun iterator(): AsyncIterator -} - -interface AsyncIterator { - operator suspend fun hasNext(): Boolean - operator suspend fun next(): T -} - -fun asyncGenerate(block: suspend AsyncGenerator.() -> Unit): AsyncSequence = object : AsyncSequence { - override fun iterator(): AsyncIterator { - val iterator = AsyncGeneratorIterator() - iterator.nextStep = block.createCoroutine(receiver = iterator, completion = iterator) - return iterator - } -} - -class AsyncGeneratorIterator: AsyncIterator, AsyncGenerator, ContinuationAdapter() { - var computedNext = false - var nextValue: T? = null - var nextStep: Continuation? = null - - // if (computesNext) computeContinuation is Continuation - // if (!computesNext) computeContinuation is Continuation - var computesNext = false - var computeContinuation: Continuation<*>? = null - - override val context = EmptyCoroutineContext - - suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c -> - computesNext = false - computeContinuation = c - nextStep!!.resume(Unit) - COROUTINE_SUSPENDED - } - - suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c -> - computesNext = true - computeContinuation = c - nextStep!!.resume(Unit) - COROUTINE_SUSPENDED - } - - @Suppress("UNCHECKED_CAST") - fun resumeIterator(exception: Throwable?) { - if (exception != null) { - done() - computeContinuation!!.resumeWithException(exception) - return - } - if (computesNext) { - computedNext = false - (computeContinuation as Continuation).resume(nextValue as T) - } else { - (computeContinuation as Continuation).resume(nextStep != null) - } - } - - override suspend fun hasNext(): Boolean { - if (!computedNext) return computeHasNext() - return nextStep != null - } - - override suspend fun next(): T { - if (!computedNext) return computeNext() - computedNext = false - return nextValue as T - } - - private fun done() { - computedNext = true - nextStep = null - } - - // Completion continuation implementation - override fun resume(value: Unit) { - done() - resumeIterator(null) - } - - override fun resumeWithException(exception: Throwable) { - done() - resumeIterator(exception) - } - - // Generator implementation - override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c -> - computedNext = true - nextValue = value - nextStep = c - resumeIterator(null) - COROUTINE_SUSPENDED - } -} - -fun builder(c: suspend () -> Unit) { - c.startCoroutine(EmptyContinuation) -} - -fun cst(a: Any?): String? = a as String? -fun any(a: Any?): Any? = a - -fun box(): String { - val seq = asyncGenerate { - yield("O") - yield("K") - } - - var res = "" - - builder { - // type of `prev` should be j/l/Object everywhere (even in a expected type position) - var prev: Any? = null - for (i in seq) { - res += i - prev = any(res) - // merge of NULL_VALUE and j/l/Object should result in common j/l/Object value - // but it was NULL_VALUE and we do not spill null values, we just put - // ACONST_NULL after suspension point instead - } - - res = cst(prev) ?: "fail 1" - } - - return res -} diff --git a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorToList_1_2.kt b/compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorToList_1_2.kt deleted file mode 100644 index 7c41fcc0246..00000000000 --- a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorToList_1_2.kt +++ /dev/null @@ -1,137 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -ExperimentalBuilderInference -// IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS -// WITH_RUNTIME -// WITH_COROUTINES -// DONT_TARGET_EXACT_BACKEND: JS_IR -// DONT_TARGET_EXACT_BACKEND: JS_IR_ES6 - -import helpers.* -import kotlin.coroutines.experimental.* -import kotlin.coroutines.experimental.intrinsics.* - -interface AsyncGenerator { - suspend fun yield(value: T) -} - -interface AsyncSequence { - operator fun iterator(): AsyncIterator -} - -interface AsyncIterator { - operator suspend fun hasNext(): Boolean - operator suspend fun next(): T -} - -fun asyncGenerate(block: suspend AsyncGenerator.() -> Unit): AsyncSequence = object : AsyncSequence { - override fun iterator(): AsyncIterator { - val iterator = AsyncGeneratorIterator() - iterator.nextStep = block.createCoroutine(receiver = iterator, completion = iterator) - return iterator - } -} - -class AsyncGeneratorIterator: AsyncIterator, AsyncGenerator, ContinuationAdapter() { - var computedNext = false - var nextValue: T? = null - var nextStep: Continuation? = null - - // if (computesNext) computeContinuation is Continuation - // if (!computesNext) computeContinuation is Continuation - var computesNext = false - var computeContinuation: Continuation<*>? = null - - override val context = EmptyCoroutineContext - - suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c -> - computesNext = false - computeContinuation = c - nextStep!!.resume(Unit) - COROUTINE_SUSPENDED - } - - suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c -> - computesNext = true - computeContinuation = c - nextStep!!.resume(Unit) - COROUTINE_SUSPENDED - } - - @Suppress("UNCHECKED_CAST") - fun resumeIterator(exception: Throwable?) { - if (exception != null) { - done() - computeContinuation!!.resumeWithException(exception) - return - } - if (computesNext) { - computedNext = false - (computeContinuation as Continuation).resume(nextValue as T) - } else { - (computeContinuation as Continuation).resume(nextStep != null) - } - } - - override suspend fun hasNext(): Boolean { - if (!computedNext) return computeHasNext() - return nextStep != null - } - - override suspend fun next(): T { - if (!computedNext) return computeNext() - computedNext = false - return nextValue as T - } - - private fun done() { - computedNext = true - nextStep = null - } - - // Completion continuation implementation - override fun resume(value: Unit) { - done() - resumeIterator(null) - } - - override fun resumeWithException(exception: Throwable) { - done() - resumeIterator(exception) - } - - // Generator implementation - override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c -> - computedNext = true - nextValue = value - nextStep = c - resumeIterator(null) - COROUTINE_SUSPENDED - } -} - -suspend fun AsyncSequence.toList(): List { - val out = arrayListOf() - for (e in this@toList) out += e // fails at this line - return out -} - -fun builder(c: suspend () -> Unit) { - c.startCoroutine(EmptyContinuation) -} - -fun box(): String { - val seq = asyncGenerate { - yield("O") - yield("K") - } - - var res = listOf() - - builder { - res = seq.toList() - } - - if (res.size > 2) return "fail 1: ${res.size}" - - return res[0] + res[1] -} diff --git a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIterator_1_2.kt b/compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIterator_1_2.kt deleted file mode 100644 index fa333108dea..00000000000 --- a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIterator_1_2.kt +++ /dev/null @@ -1,131 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -ExperimentalBuilderInference -// IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS -// WITH_RUNTIME -// WITH_COROUTINES -// DONT_TARGET_EXACT_BACKEND: JS_IR -// DONT_TARGET_EXACT_BACKEND: JS_IR_ES6 - -import helpers.* -import kotlin.coroutines.experimental.* -import kotlin.coroutines.experimental.intrinsics.* - -interface AsyncGenerator { - suspend fun yield(value: T) -} - -interface AsyncSequence { - operator fun iterator(): AsyncIterator -} - -interface AsyncIterator { - operator suspend fun hasNext(): Boolean - operator suspend fun next(): T -} - -fun asyncGenerate(block: suspend AsyncGenerator.() -> Unit): AsyncSequence = object : AsyncSequence { - override fun iterator(): AsyncIterator { - val iterator = AsyncGeneratorIterator() - iterator.nextStep = block.createCoroutine(receiver = iterator, completion = iterator) - return iterator - } -} - -class AsyncGeneratorIterator: AsyncIterator, AsyncGenerator, ContinuationAdapter() { - var computedNext = false - var nextValue: T? = null - var nextStep: Continuation? = null - - // if (computesNext) computeContinuation is Continuation - // if (!computesNext) computeContinuation is Continuation - var computesNext = false - var computeContinuation: Continuation<*>? = null - - override val context = EmptyCoroutineContext - - suspend fun computeHasNext(): Boolean = suspendCoroutineUninterceptedOrReturn { c -> - computesNext = false - computeContinuation = c - nextStep!!.resume(Unit) - COROUTINE_SUSPENDED - } - - suspend fun computeNext(): T = suspendCoroutineUninterceptedOrReturn { c -> - computesNext = true - computeContinuation = c - nextStep!!.resume(Unit) - COROUTINE_SUSPENDED - } - - @Suppress("UNCHECKED_CAST") - fun resumeIterator(exception: Throwable?) { - if (exception != null) { - done() - computeContinuation!!.resumeWithException(exception) - return - } - if (computesNext) { - computedNext = false - (computeContinuation as Continuation).resume(nextValue as T) - } else { - (computeContinuation as Continuation).resume(nextStep != null) - } - } - - override suspend fun hasNext(): Boolean { - if (!computedNext) return computeHasNext() - return nextStep != null - } - - override suspend fun next(): T { - if (!computedNext) return computeNext() - computedNext = false - return nextValue as T - } - - private fun done() { - computedNext = true - nextStep = null - } - - // Completion continuation implementation - override fun resume(value: Unit) { - done() - resumeIterator(null) - } - - override fun resumeWithException(exception: Throwable) { - done() - resumeIterator(exception) - } - - // Generator implementation - override suspend fun yield(value: T): Unit = suspendCoroutineUninterceptedOrReturn { c -> - computedNext = true - nextValue = value - nextStep = c - resumeIterator(null) - COROUTINE_SUSPENDED - } -} - -fun builder(c: suspend () -> Unit) { - c.startCoroutine(EmptyContinuation) -} - -fun box(): String { - val seq = asyncGenerate { - yield("O") - yield("K") - } - - var res = "" - - builder { - for (i in seq) { - res += i - } - } - - return res -} diff --git a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow/kt22694_1_2.kt b/compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow/kt22694_1_2.kt deleted file mode 100644 index 2eaa4c35dd1..00000000000 --- a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow/kt22694_1_2.kt +++ /dev/null @@ -1,51 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -// IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS -// WITH_RUNTIME -// WITH_COROUTINES -// DONT_TARGET_EXACT_BACKEND: JS_IR -// DONT_TARGET_EXACT_BACKEND: JS_IR_ES6 - -import helpers.* -import kotlin.coroutines.experimental.* - -enum class Foo(vararg expected: String) { - A("start", "A", "end"), - B("start", "BCD", "end"), - C("start", "BCD", "end"), - D("start", "BCD", "end"), - E("start", "E", "end"), - F("start", "end"); - - val expected = expected.toList() -} - -fun box(): String { - for (c in Foo.values()) { - val actual = getSequence(c).toList() - if (actual != c.expected) { - return "FAIL: -- ${c.expected} != $actual" - } - } - - return "OK" -} - -fun getSequence(a: Foo) = - buildSequence { - yield("start") - when (a) { - Foo.A -> { - yield("A") - } - Foo.B, - Foo.C, - Foo.D-> { - yield("BCD") - } - Foo.E-> { - yield("E") - } - } - yield("end") - } diff --git a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/coroutineToString_1_2.kt b/compiler/testData/codegen/box/oldLanguageVersions/coroutines/coroutineToString_1_2.kt deleted file mode 100644 index c91bd4d9c3e..00000000000 --- a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/coroutineToString_1_2.kt +++ /dev/null @@ -1,35 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -// IGNORE_BACKEND: JVM_IR -// TARGET_BACKEND: JVM -// WITH_REFLECT -// WITH_COROUTINES - -import helpers.* -import kotlin.coroutines.experimental.* -import kotlin.coroutines.experimental.intrinsics.* - -class A { - suspend fun foo() {} - - suspend fun bar(): T { - foo() - return suspendCoroutineUninterceptedOrReturn { x -> - x.resume(x.toString() as T) - COROUTINE_SUSPENDED - } - } -} - -fun builder(c: suspend () -> Unit) { - c.startCoroutine(EmptyContinuation) -} - -fun box(): String { - var result = "" - - builder { - result = A().bar() - } - - return if (result == "(kotlin.coroutines.experimental.Continuation) -> kotlin.Any?") "OK" else "Fail: $result" -} diff --git a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/createCoroutinesOnManualInstances_1_2.kt b/compiler/testData/codegen/box/oldLanguageVersions/coroutines/createCoroutinesOnManualInstances_1_2.kt deleted file mode 100644 index 55303523843..00000000000 --- a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/createCoroutinesOnManualInstances_1_2.kt +++ /dev/null @@ -1,98 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -// WITH_RUNTIME -// WITH_COROUTINES -// DONT_TARGET_EXACT_BACKEND: JS_IR -// DONT_TARGET_EXACT_BACKEND: JS_IR_ES6 -// IGNORE_BACKEND: JS - -import kotlin.coroutines.experimental.* -import kotlin.coroutines.experimental.intrinsics.COROUTINE_SUSPENDED - -fun runCustomLambdaAsCoroutine(e: Throwable? = null, x: (Continuation) -> Any?): String { - var result = "fail" - var wasIntercepted = false - val c = (x as suspend () -> String).createCoroutine(object: helpers.ContinuationAdapter() { - override fun resumeWithException(exception: Throwable) { - throw exception - } - - override val context: CoroutineContext - get() = object: ContinuationInterceptor { - override fun fold(initial: R, operation: (R, CoroutineContext.Element) -> R): R { - throw IllegalStateException() - } - - override fun get(key: CoroutineContext.Key): E? { - if (key == ContinuationInterceptor.Key) { - return this as E - } - return null - } - - override fun interceptContinuation(continuation: Continuation) = object : helpers.ContinuationAdapter() { - override val context: CoroutineContext - get() = continuation.context - - override fun resume(value: T) { - wasIntercepted = true - continuation.resume(value) - } - - override fun resumeWithException(exception: Throwable) { - wasIntercepted = true - continuation.resumeWithException(exception) - } - } - - override fun minusKey(key: CoroutineContext.Key<*>): CoroutineContext { - throw IllegalStateException() - } - - override fun plus(context: CoroutineContext): CoroutineContext { - throw IllegalStateException() - } - - override val key: CoroutineContext.Key<*> - get() = ContinuationInterceptor.Key - } - - override fun resume(value: String) { - result = value - } - }) - - if (e != null) - c.resumeWithException(e) - else - c.resume(Unit) - - if (!wasIntercepted) return "was not intercepted" - - return result -} - -fun box(): String { - val x = runCustomLambdaAsCoroutine { - it.resume("OK") - COROUTINE_SUSPENDED - } - - if (x != "OK") return "fail 1: $x" - - val y = runCustomLambdaAsCoroutine { - "OK" - } - - if (y != "OK") return "fail 2: $x" - - - try { - runCustomLambdaAsCoroutine(RuntimeException("OK")) { - throw RuntimeException("fail 3") - } - } catch(e: Exception) { - return e.message!! - } - - return "fail 3" -} diff --git a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection/suspendFunction_1_2.kt b/compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection/suspendFunction_1_2.kt deleted file mode 100644 index a5bffaf2804..00000000000 --- a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection/suspendFunction_1_2.kt +++ /dev/null @@ -1,23 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -// IGNORE_BACKEND: JS_IR, JS -// IGNORE_BACKEND: JS_IR_ES6 -// IGNORE_BACKEND: JVM_IR -// WITH_RUNTIME -// WITH_COROUTINES - -// some classes are moved from stdlib to compatibility package -// IGNORE_BACKEND: ANDROID - -import helpers.* -import kotlin.coroutines.* - -val lambda1 = { x: Any -> } as (Any) -> Unit -val suspendLambda0: suspend () -> Unit = {} - -fun box(): String { - assert(lambda1 is SuspendFunction0<*>) { "Failed: lambda1 !is SuspendFunction0<*>" } - assert(suspendLambda0 is Function1<*, *>) { "Failed: suspendLambda0 is Function1<*, *>" } - assert(suspendLambda0 is SuspendFunction0<*>) { "Failed: suspendLambda0 is SuspendFunction0<*>" } - - return "OK" -} diff --git a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/illegalState_1_2.kt b/compiler/testData/codegen/box/oldLanguageVersions/coroutines/illegalState_1_2.kt deleted file mode 100644 index 5e29306d5e2..00000000000 --- a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/illegalState_1_2.kt +++ /dev/null @@ -1,74 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -// IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS -// WITH_RUNTIME -// WITH_COROUTINES - -import helpers.* -// TARGET_BACKEND: JVM -import kotlin.coroutines.experimental.* -import kotlin.coroutines.experimental.intrinsics.* - -suspend fun suspendHere(): Unit = suspendCoroutineUninterceptedOrReturn { x -> - x.resume(Unit) - COROUTINE_SUSPENDED -} - -fun builder1(c: suspend () -> Unit) { - (c as Continuation).resume(Unit) -} - -fun builder2(c: suspend () -> Unit) { - val continuation = c.createCoroutine(EmptyContinuation) - - val delegateField = continuation.javaClass.getDeclaredField("delegate") - delegateField.setAccessible(true) - val originalContinuation = delegateField.get(continuation) - - val declaredField = originalContinuation.javaClass.superclass.getDeclaredField("label") - declaredField.setAccessible(true) - declaredField.set(originalContinuation, -3) - continuation.resume(Unit) -} - -fun box(): String { - - try { - builder1 { - suspendHere() - } - return "fail 1" - } catch (e: kotlin.KotlinNullPointerException) { - } - - try { - builder2 { - suspendHere() - } - return "fail 3" - } catch (e: java.lang.IllegalStateException) { - if (e.message != "call to 'resume' before 'invoke' with coroutine") return "fail 4: ${e.message!!}" - } - - var result = "OK" - - try { - builder1 { - result = "fail 5" - } - return "fail 6" - } catch (e: kotlin.KotlinNullPointerException) { - } - - try { - builder2 { - result = "fail 8" - } - return "fail 9" - } catch (e: java.lang.IllegalStateException) { - if (e.message != "call to 'resume' before 'invoke' with coroutine") return "fail 10: ${e.message!!}" - return result - } - - return "fail" -} diff --git a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule/inlineWithJava_1_2.kt b/compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule/inlineWithJava_1_2.kt deleted file mode 100644 index c1d75f99f71..00000000000 --- a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule/inlineWithJava_1_2.kt +++ /dev/null @@ -1,45 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -// IGNORE_BACKEND: JVM_IR -// TARGET_BACKEND: JVM -// WITH_COROUTINES -// WITH_RUNTIME -// MODULE: lib -// FILE: lib.kt - -interface I {} - -suspend inline fun foo() = object : I {} - -// MODULE: useLib(lib) -// FILE: UseLib.java -import kotlin.coroutines.experimental.*; -import kotlin.Unit; - -public class UseLib { - public static String useFoo() { - Object i = LibKt.foo(new MyContinuation()); - return i.getClass().getName() + " " + i.getClass().getEnclosingClass().getName() + " " + i.getClass().getEnclosingClass().getEnclosingClass(); - } -} - -class MyContinuation implements Continuation { - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - public void resume(I value) {} - public void resumeWithException(Throwable e) { - throw new RuntimeException(e); - } -} - -// MODULE: main(useLib) -// FILE: main.kt - -fun box(): String { - val res = UseLib.useFoo() - if (res == "LibKt\$foo\$2 LibKt null") { - return "OK" - } else { - return res - } -} diff --git a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect/isSuspend_1_2.kt b/compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect/isSuspend_1_2.kt deleted file mode 100644 index aad304aa2a9..00000000000 --- a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect/isSuspend_1_2.kt +++ /dev/null @@ -1,20 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -// WITH_COROUTINES -// WITH_REFLECT -// DONT_TARGET_EXACT_BACKEND: JS_IR -// DONT_TARGET_EXACT_BACKEND: JS_IR_ES6 - -// IGNORE_BACKEND: NATIVE -// IGNORE_BACKEND: JS - -import helpers.* -import kotlin.coroutines.experimental.* - -class A { - fun noArgs() = "OK" -} - -fun box(): String { - if (A::noArgs.isSuspend) return "FAIL" - return "OK" -} diff --git a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendCovariantJavaOverrides_1_2.kt b/compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendCovariantJavaOverrides_1_2.kt deleted file mode 100644 index 87290886230..00000000000 --- a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendCovariantJavaOverrides_1_2.kt +++ /dev/null @@ -1,50 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -// IGNORE_BACKEND: JVM_IR -// TARGET_BACKEND: JVM -// WITH_RUNTIME -// WITH_COROUTINES - -// FILE: I.kt - -interface I { - suspend fun foo(x: Int): String - suspend fun bar(x: Int): String -} - -// FILE: JavaClass.java - -public class JavaClass implements I { - @Override - public String foo(int x, kotlin.coroutines.experimental.Continuation continuation) { - return "O"; - } - - @Override - public Object bar(int x, kotlin.coroutines.experimental.Continuation continuation) { - return foo(x, continuation); - } -} - -// FILE: main.kt -import helpers.* -import kotlin.coroutines.experimental.* -import kotlin.coroutines.experimental.intrinsics.* - -class K : JavaClass() { - override suspend fun foo(x: Int): String = super.foo(x) + suspendCoroutine { it.resume("K") } -} - -fun builder(c: suspend () -> Unit) { - c.startCoroutine(EmptyContinuation) -} - -fun box(): String { - var result = "fail" - - builder { - // Changing the call to 'K().bar(1)' doesn't work because of KT-25036 - result = K().foo(1) - } - - return result -} diff --git a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt b/compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt deleted file mode 100644 index 7772c83d801..00000000000 --- a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt +++ /dev/null @@ -1,22 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -// IGNORE_BACKEND: JVM_IR -// IGNORE_BACKEND: JS -// WITH_RUNTIME -// WITH_COROUTINES -// DONT_TARGET_EXACT_BACKEND: JS_IR -// DONT_TARGET_EXACT_BACKEND: JS_IR_ES6 - -import helpers.* -import kotlin.coroutines.experimental.* - -val f = run { - buildSequence { - if (true) { - yield("OK") - } - }.toList() -} - -fun box(): String { - return f[0] -} diff --git a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/openFunWithJava_1_2.kt b/compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/openFunWithJava_1_2.kt deleted file mode 100644 index 5f50a8c992b..00000000000 --- a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/openFunWithJava_1_2.kt +++ /dev/null @@ -1,61 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -// IGNORE_BACKEND: JVM_IR -// WITH_RUNTIME -// WITH_COROUTINES -// FILE: main.kt -// TARGET_BACKEND: JVM - -import helpers.* -import kotlin.coroutines.experimental.* -import kotlin.coroutines.experimental.intrinsics.* - -open class A(val v: String) { - suspend fun suspendThere(v: String): String = suspendCoroutineUninterceptedOrReturn { x -> - x.resume(v) - COROUTINE_SUSPENDED - } - - open suspend fun suspendHere(): String = suspendThere("O") + suspendThere(v) -} - -class B(v: String) : A(v) { - override suspend fun suspendHere(): String = super.suspendHere() + suspendThere("56") -} - -fun builder(c: suspend A.() -> Unit) { - c.startCoroutine(B("K"), EmptyContinuation) -} - -fun box(): String { - var result = JavaClass.foo() - - if (result != "OK56") return "fail 1: $result" - - return "OK" -} - -// FILE: JavaClass.java -import kotlin.coroutines.experimental.*; -public class JavaClass { - public static String foo() { - final String[] res = new String[1]; - - new B("K").suspendHere(new Continuation() { - @Override - public CoroutineContext getContext() { - return EmptyCoroutineContext.INSTANCE; - } - - @Override - public void resume(String s) { - res[0] = s; - } - - @Override - public void resumeWithException(Throwable throwable) { - } - }); - - return res[0]; - } -} diff --git a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendJavaOverrides_1_2.kt b/compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendJavaOverrides_1_2.kt deleted file mode 100644 index 163158a1e89..00000000000 --- a/compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendJavaOverrides_1_2.kt +++ /dev/null @@ -1,40 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -// IGNORE_BACKEND: JVM_IR -// TARGET_BACKEND: JVM -// WITH_RUNTIME -// WITH_COROUTINES - -// FILE: I.kt - -interface I { - suspend fun foo(x: Int): String -} - -// FILE: JavaClass.java - -public class JavaClass implements I { - @Override - public Object foo(int x, kotlin.coroutines.experimental.Continuation continuation) { - continuation.resume("OK"); - return kotlin.coroutines.experimental.intrinsics.IntrinsicsKt.getCOROUTINE_SUSPENDED(); - } -} - -// FILE: main.kt -import helpers.* -import kotlin.coroutines.experimental.* -import kotlin.coroutines.experimental.intrinsics.* - -fun builder(c: suspend () -> Unit) { - c.startCoroutine(EmptyContinuation) -} - -fun box(): String { - var result = "fail" - - builder { - result = JavaClass().foo(1) - } - - return result -} diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java index 4a77950d146..a5714bb15d7 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/BlackBoxCodegenTestGenerated.java @@ -20297,154 +20297,6 @@ public class BlackBoxCodegenTestGenerated extends AbstractBlackBoxCodegenTest { } } - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Coroutines extends AbstractBlackBoxCodegenTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInCoroutines() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("asyncIteratorNullMerge_1_2.kt") - public void testAsyncIteratorNullMerge_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorNullMerge_1_2.kt"); - } - - @TestMetadata("asyncIteratorToList_1_2.kt") - public void testAsyncIteratorToList_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorToList_1_2.kt"); - } - - @TestMetadata("asyncIterator_1_2.kt") - public void testAsyncIterator_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIterator_1_2.kt"); - } - - @TestMetadata("coroutineToString_1_2.kt") - public void testCoroutineToString_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/coroutineToString_1_2.kt"); - } - - @TestMetadata("createCoroutinesOnManualInstances_1_2.kt") - public void testCreateCoroutinesOnManualInstances_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/createCoroutinesOnManualInstances_1_2.kt"); - } - - @TestMetadata("illegalState_1_2.kt") - public void testIllegalState_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/illegalState_1_2.kt"); - } - - @TestMetadata("suspendCovariantJavaOverrides_1_2.kt") - public void testSuspendCovariantJavaOverrides_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendCovariantJavaOverrides_1_2.kt"); - } - - @TestMetadata("suspendJavaOverrides_1_2.kt") - public void testSuspendJavaOverrides_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendJavaOverrides_1_2.kt"); - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ControlFlow extends AbstractBlackBoxCodegenTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInControlFlow() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("kt22694_1_2.kt") - public void testKt22694_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow/kt22694_1_2.kt"); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class FeatureIntersection extends AbstractBlackBoxCodegenTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInFeatureIntersection() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("suspendFunction_1_2.kt") - public void testSuspendFunction_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection/suspendFunction_1_2.kt"); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class MultiModule extends AbstractBlackBoxCodegenTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInMultiModule() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("inlineWithJava_1_2.kt") - public void testInlineWithJava_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule/inlineWithJava_1_2.kt"); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Reflect extends AbstractBlackBoxCodegenTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInReflect() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("isSuspend_1_2.kt") - public void testIsSuspend_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect/isSuspend_1_2.kt"); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class SuspendFunctionAsCoroutine extends AbstractBlackBoxCodegenTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInSuspendFunctionAsCoroutine() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("ifExpressionInsideCoroutine_1_2.kt") - public void testIfExpressionInsideCoroutine_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt"); - } - - @TestMetadata("openFunWithJava_1_2.kt") - public void testOpenFunWithJava_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/openFunWithJava_1_2.kt"); - } - } - } - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/functions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java index fb923e6527a..63fdedf93e3 100644 --- a/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java +++ b/compiler/tests-gen/org/jetbrains/kotlin/codegen/LightAnalysisModeTestGenerated.java @@ -20297,154 +20297,6 @@ public class LightAnalysisModeTestGenerated extends AbstractLightAnalysisModeTes } } - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Coroutines extends AbstractLightAnalysisModeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInCoroutines() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("asyncIteratorNullMerge_1_2.kt") - public void testAsyncIteratorNullMerge_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorNullMerge_1_2.kt"); - } - - @TestMetadata("asyncIteratorToList_1_2.kt") - public void testAsyncIteratorToList_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorToList_1_2.kt"); - } - - @TestMetadata("asyncIterator_1_2.kt") - public void testAsyncIterator_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIterator_1_2.kt"); - } - - @TestMetadata("coroutineToString_1_2.kt") - public void testCoroutineToString_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/coroutineToString_1_2.kt"); - } - - @TestMetadata("createCoroutinesOnManualInstances_1_2.kt") - public void testCreateCoroutinesOnManualInstances_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/createCoroutinesOnManualInstances_1_2.kt"); - } - - @TestMetadata("illegalState_1_2.kt") - public void testIllegalState_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/illegalState_1_2.kt"); - } - - @TestMetadata("suspendCovariantJavaOverrides_1_2.kt") - public void testSuspendCovariantJavaOverrides_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendCovariantJavaOverrides_1_2.kt"); - } - - @TestMetadata("suspendJavaOverrides_1_2.kt") - public void testSuspendJavaOverrides_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendJavaOverrides_1_2.kt"); - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ControlFlow extends AbstractLightAnalysisModeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInControlFlow() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("kt22694_1_2.kt") - public void testKt22694_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow/kt22694_1_2.kt"); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class FeatureIntersection extends AbstractLightAnalysisModeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInFeatureIntersection() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("suspendFunction_1_2.kt") - public void testSuspendFunction_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection/suspendFunction_1_2.kt"); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class MultiModule extends AbstractLightAnalysisModeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInMultiModule() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("inlineWithJava_1_2.kt") - public void testInlineWithJava_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule/inlineWithJava_1_2.kt"); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Reflect extends AbstractLightAnalysisModeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInReflect() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("isSuspend_1_2.kt") - public void testIsSuspend_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect/isSuspend_1_2.kt"); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class SuspendFunctionAsCoroutine extends AbstractLightAnalysisModeTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest(this::doTest, TargetBackend.JVM, testDataFilePath); - } - - public void testAllFilesPresentInSuspendFunctionAsCoroutine() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JVM, true); - } - - @TestMetadata("ifExpressionInsideCoroutine_1_2.kt") - public void testIfExpressionInsideCoroutine_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt"); - } - - @TestMetadata("openFunWithJava_1_2.kt") - public void testOpenFunWithJava_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/openFunWithJava_1_2.kt"); - } - } - } - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/functions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java index d73f082b1d0..28c85588981 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/es6/semantics/IrJsCodegenBoxES6TestGenerated.java @@ -16297,89 +16297,6 @@ public class IrJsCodegenBoxES6TestGenerated extends AbstractIrJsCodegenBoxES6Tes } } - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Coroutines extends AbstractIrJsCodegenBoxES6Test { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); - } - - public void testAllFilesPresentInCoroutines() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ControlFlow extends AbstractIrJsCodegenBoxES6Test { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); - } - - public void testAllFilesPresentInControlFlow() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class FeatureIntersection extends AbstractIrJsCodegenBoxES6Test { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); - } - - public void testAllFilesPresentInFeatureIntersection() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); - } - - @TestMetadata("suspendFunction_1_2.kt") - public void testSuspendFunction_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection/suspendFunction_1_2.kt"); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class MultiModule extends AbstractIrJsCodegenBoxES6Test { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); - } - - public void testAllFilesPresentInMultiModule() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Reflect extends AbstractIrJsCodegenBoxES6Test { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); - } - - public void testAllFilesPresentInReflect() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class SuspendFunctionAsCoroutine extends AbstractIrJsCodegenBoxES6Test { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR_ES6, testDataFilePath); - } - - public void testAllFilesPresentInSuspendFunctionAsCoroutine() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR_ES6, true); - } - } - } - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/functions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java index 4ff74f60449..e60fa3485e9 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/ir/semantics/IrJsCodegenBoxTestGenerated.java @@ -16297,89 +16297,6 @@ public class IrJsCodegenBoxTestGenerated extends AbstractIrJsCodegenBoxTest { } } - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Coroutines extends AbstractIrJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); - } - - public void testAllFilesPresentInCoroutines() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ControlFlow extends AbstractIrJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); - } - - public void testAllFilesPresentInControlFlow() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class FeatureIntersection extends AbstractIrJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); - } - - public void testAllFilesPresentInFeatureIntersection() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); - } - - @TestMetadata("suspendFunction_1_2.kt") - public void testSuspendFunction_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection/suspendFunction_1_2.kt"); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class MultiModule extends AbstractIrJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); - } - - public void testAllFilesPresentInMultiModule() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Reflect extends AbstractIrJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); - } - - public void testAllFilesPresentInReflect() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class SuspendFunctionAsCoroutine extends AbstractIrJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS_IR, testDataFilePath); - } - - public void testAllFilesPresentInSuspendFunctionAsCoroutine() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS_IR, true); - } - } - } - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/functions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class) diff --git a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java index b71e5cf4809..da8c458c93d 100644 --- a/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java +++ b/js/js.tests/tests-gen/org/jetbrains/kotlin/js/test/semantics/JsCodegenBoxTestGenerated.java @@ -16362,124 +16362,6 @@ public class JsCodegenBoxTestGenerated extends AbstractJsCodegenBoxTest { } } - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Coroutines extends AbstractJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); - } - - public void testAllFilesPresentInCoroutines() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); - } - - @TestMetadata("asyncIteratorNullMerge_1_2.kt") - public void testAsyncIteratorNullMerge_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorNullMerge_1_2.kt"); - } - - @TestMetadata("asyncIteratorToList_1_2.kt") - public void testAsyncIteratorToList_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIteratorToList_1_2.kt"); - } - - @TestMetadata("asyncIterator_1_2.kt") - public void testAsyncIterator_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/asyncIterator_1_2.kt"); - } - - @TestMetadata("createCoroutinesOnManualInstances_1_2.kt") - public void testCreateCoroutinesOnManualInstances_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/createCoroutinesOnManualInstances_1_2.kt"); - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class ControlFlow extends AbstractJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); - } - - public void testAllFilesPresentInControlFlow() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); - } - - @TestMetadata("kt22694_1_2.kt") - public void testKt22694_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/controlFlow/kt22694_1_2.kt"); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class FeatureIntersection extends AbstractJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); - } - - public void testAllFilesPresentInFeatureIntersection() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); - } - - @TestMetadata("suspendFunction_1_2.kt") - public void testSuspendFunction_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/featureIntersection/suspendFunction_1_2.kt"); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class MultiModule extends AbstractJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); - } - - public void testAllFilesPresentInMultiModule() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/multiModule"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class Reflect extends AbstractJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); - } - - public void testAllFilesPresentInReflect() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); - } - - @TestMetadata("isSuspend_1_2.kt") - public void testIsSuspend_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/reflect/isSuspend_1_2.kt"); - } - } - - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine") - @TestDataPath("$PROJECT_ROOT") - @RunWith(JUnit3RunnerWithInners.class) - public static class SuspendFunctionAsCoroutine extends AbstractJsCodegenBoxTest { - private void runTest(String testDataFilePath) throws Exception { - KotlinTestUtils.runTest0(this::doTest, TargetBackend.JS, testDataFilePath); - } - - public void testAllFilesPresentInSuspendFunctionAsCoroutine() throws Exception { - KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine"), Pattern.compile("^(.+)\\.kt$"), null, TargetBackend.JS, true); - } - - @TestMetadata("ifExpressionInsideCoroutine_1_2.kt") - public void testIfExpressionInsideCoroutine_1_2() throws Exception { - runTest("compiler/testData/codegen/box/oldLanguageVersions/coroutines/suspendFunctionAsCoroutine/ifExpressionInsideCoroutine_1_2.kt"); - } - } - } - @TestMetadata("compiler/testData/codegen/box/oldLanguageVersions/functions") @TestDataPath("$PROJECT_ROOT") @RunWith(JUnit3RunnerWithInners.class)