diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/release/coroutineContext.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/release/coroutineContext.fir.kt deleted file mode 100644 index 63667e6256c..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/release/coroutineContext.fir.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !LANGUAGE: +ReleaseCoroutines -// SKIP_TXT - -import kotlin.coroutines.experimental.coroutineContext - -suspend fun test() { - coroutineContext -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/release/coroutineContext.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/release/coroutineContext.kt deleted file mode 100644 index 76f47275c19..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/release/coroutineContext.kt +++ /dev/null @@ -1,8 +0,0 @@ -// !LANGUAGE: +ReleaseCoroutines -// SKIP_TXT - -import kotlin.coroutines.experimental.coroutineContext - -suspend fun test() { - coroutineContext -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/release/languageVersionIsNotEqualToApiVersion.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/release/languageVersionIsNotEqualToApiVersion.fir.kt deleted file mode 100644 index 9d872adc72a..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/release/languageVersionIsNotEqualToApiVersion.fir.kt +++ /dev/null @@ -1,38 +0,0 @@ -// !API_VERSION: 1.2 -// !DIAGNOSTICS: -UNUSED_PARAMETER -// !LANGUAGE: +ReleaseCoroutines -// !WITH_NEW_INFERENCE -// SKIP_TXT - -suspend fun dummy() {} - -// TODO: Forbid -fun builder(c: suspend () -> Unit) {} - -suspend fun test1() { - kotlin.coroutines.coroutineContext - - kotlin.coroutines.experimental.coroutineContext - - suspend {}() - - dummy() - - val c: suspend () -> Unit = {} - c() - - builder {} -} - -fun test2() { - kotlin.coroutines.experimental.buildSequence { - yield(1) - } - kotlin.sequences.buildSequence { - yield(1) - } -} - -suspend fun test3(): Unit = kotlin.coroutines.experimental.suspendCoroutine { _ -> Unit } - -suspend fun test4(): Unit = kotlin.coroutines.suspendCoroutine { _ -> Unit } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/release/languageVersionIsNotEqualToApiVersion.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/release/languageVersionIsNotEqualToApiVersion.kt deleted file mode 100644 index 88e8f78ee0a..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/release/languageVersionIsNotEqualToApiVersion.kt +++ /dev/null @@ -1,38 +0,0 @@ -// !API_VERSION: 1.2 -// !DIAGNOSTICS: -UNUSED_PARAMETER -// !LANGUAGE: +ReleaseCoroutines -// !WITH_NEW_INFERENCE -// SKIP_TXT - -suspend fun dummy() {} - -// TODO: Forbid -fun builder(c: suspend () -> Unit) {} - -suspend fun test1() { - kotlin.coroutines.coroutineContext - - kotlin.coroutines.experimental.coroutineContext - - suspend {}() - - dummy() - - val c: suspend () -> Unit = {} - c() - - builder {} -} - -fun test2() { - kotlin.coroutines.experimental.buildSequence { - yield(1) - } - kotlin.sequences.buildSequence { - yield(1) - } -} - -suspend fun test3(): Unit = kotlin.coroutines.experimental.suspendCoroutine { _ -> Unit } - -suspend fun test4(): Unit = kotlin.coroutines.suspendCoroutine { _ -> Unit } diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.fir.kt deleted file mode 100644 index cb9c725dd29..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.fir.kt +++ /dev/null @@ -1,94 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -ExperimentalBuilderInference -// !DIAGNOSTICS: -EXPERIMENTAL_FEATURE_WARNING -// !WITH_NEW_INFERENCE -// SKIP_TXT - -@kotlin.coroutines.experimental.RestrictsSuspension -class RestrictedController { - suspend fun yield(x: T) {} - - suspend fun anotherYield(x: T) { - yield(x) - this.yield(x) - - yield2(x) - this.yield2(x) - - with(this) { - yield(x) - this@with.yield(x) - - yield2(x) - this@with.yield2(x) - } - } -} - -fun buildSequence(c: suspend RestrictedController.() -> Unit) {} -suspend fun RestrictedController.yield2(x: T) {} - -fun test() { - buildSequence a@{ - buildSequence b@{ - yield(1) - yield2(1) - this@b.yield(1) - this@b.yield2(1) - - this@a.yield(2) // Should be error - this@a.yield2(2) // Should be error - - with(this) { - yield(3) - this@with.yield(3) - - yield2(3) - this@with.yield2(3) - } - } - } - - buildSequence { - buildSequence { - yield("a") - yield2("a") - this.yield("b") - this.yield2("b") - - yield(1) // Should be error - yield2(1) // Should be error - - with(this) { - yield("") - this@with.yield("") - - yield2("") - this@with.yield2("") - } - } - } - - buildSequence a@{ - yield(1) - yield2(1) - buildSequence { - yield("") - yield2("") - this@a.yield(1) - this@a.yield2(1) - - with(this) { - yield("") - this@with.yield("") - - yield2("") - this@with.yield2("") - } - } - } - - buildSequence { - yield("") - RestrictedController().yield("1") - } -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.kt deleted file mode 100644 index d57a7f75988..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.kt +++ /dev/null @@ -1,94 +0,0 @@ -// !LANGUAGE: -ReleaseCoroutines -ExperimentalBuilderInference -// !DIAGNOSTICS: -EXPERIMENTAL_FEATURE_WARNING -// !WITH_NEW_INFERENCE -// SKIP_TXT - -@kotlin.coroutines.experimental.RestrictsSuspension -class RestrictedController { - suspend fun yield(x: T) {} - - suspend fun anotherYield(x: T) { - yield(x) - this.yield(x) - - yield2(x) - this.yield2(x) - - with(this) { - yield(x) - this@with.yield(x) - - yield2(x) - this@with.yield2(x) - } - } -} - -fun buildSequence(c: suspend RestrictedController.() -> Unit) {} -suspend fun RestrictedController.yield2(x: T) {} - -fun test() { - buildSequence a@{ - buildSequence b@{ - yield(1) - yield2(1) - this@b.yield(1) - this@b.yield2(1) - - this@a.yield(2) // Should be error - this@a.yield2(2) // Should be error - - with(this) { - yield(3) - this@with.yield(3) - - yield2(3) - this@with.yield2(3) - } - } - } - - buildSequence { - buildSequence { - yield("a") - yield2("a") - this.yield("b") - this.yield2("b") - - yield(1) // Should be error - yield2(1) // Should be error - - with(this) { - yield("") - this@with.yield("") - - yield2("") - this@with.yield2("") - } - } - } - - buildSequence a@{ - yield(1) - yield2(1) - buildSequence { - yield("") - yield2("") - this@a.yield(1) - this@a.yield2(1) - - with(this) { - yield("") - this@with.yield("") - - yield2("") - this@with.yield2("") - } - } - } - - buildSequence { - yield("") - RestrictedController().yield("1") - } -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithNewAPI.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithNewAPI.kt deleted file mode 100644 index 2e262aa0861..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithNewAPI.kt +++ /dev/null @@ -1,16 +0,0 @@ -// FIR_IDENTICAL -// !API_VERSION: 1.1 -// !LANGUAGE: +Coroutines -ReleaseCoroutines -// SKIP_TXT - -import kotlin.coroutines.experimental.* -import kotlin.coroutines.experimental.intrinsics.* - -suspend fun foo(): Unit = suspendCoroutine { - it.resume(Unit) -} - -suspend fun bar(): Unit = suspendCoroutineOrReturn { - it.resume(Unit) - COROUTINE_SUSPENDED -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithOldAPI.fir.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithOldAPI.fir.kt deleted file mode 100644 index a7f1c382a1f..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithOldAPI.fir.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !API_VERSION: 1.0 -// SKIP_TXT - -import kotlin.coroutines.experimental.* -import kotlin.coroutines.experimental.intrinsics.* - -suspend fun foo(): Unit = suspendCoroutine { - it.resume(Unit) -} - -suspend fun bar(): Unit = suspendCoroutineUninterceptedOrReturn { - it.resume(Unit) - COROUTINE_SUSPENDED -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithOldAPI.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithOldAPI.kt deleted file mode 100644 index 88f8c40b79e..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithOldAPI.kt +++ /dev/null @@ -1,14 +0,0 @@ -// !API_VERSION: 1.0 -// SKIP_TXT - -import kotlin.coroutines.experimental.* -import kotlin.coroutines.experimental.intrinsics.* - -suspend fun foo(): Unit = suspendCoroutine { - it.resume(Unit) -} - -suspend fun bar(): Unit = suspendCoroutineUninterceptedOrReturn { - it.resume(Unit) - COROUTINE_SUSPENDED -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction_1_2.kt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction_1_2.kt deleted file mode 100644 index 33258efbc9d..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction_1_2.kt +++ /dev/null @@ -1,10 +0,0 @@ -// FIR_IDENTICAL -// !DIAGNOSTICS: -DEPRECATION -// Tail calls are not allowed to be Nothing typed. See KT-15051 -import kotlin.coroutines.experimental.* -import kotlin.coroutines.experimental.intrinsics.* - -suspend fun suspendLogAndThrow(exception: Throwable): Nothing = suspendCoroutineUninterceptedOrReturn { c -> - c.resumeWithException(exception) - COROUTINE_SUSPENDED -} diff --git a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction_1_2.txt b/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction_1_2.txt deleted file mode 100644 index 662ae2a6501..00000000000 --- a/compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction_1_2.txt +++ /dev/null @@ -1,3 +0,0 @@ -package - -public suspend fun suspendLogAndThrow(/*0*/ exception: kotlin.Throwable): kotlin.Nothing diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java index 6d07fe643a5..6e09f40619a 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/DiagnosticTestGenerated.java @@ -32427,18 +32427,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn_1_2.kt"); } - @Test - @TestMetadata("suspendCoroutineUnavailableWithNewAPI.kt") - public void testSuspendCoroutineUnavailableWithNewAPI() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithNewAPI.kt"); - } - - @Test - @TestMetadata("suspendCoroutineUnavailableWithOldAPI.kt") - public void testSuspendCoroutineUnavailableWithOldAPI() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithOldAPI.kt"); - } - @Test @TestMetadata("suspendCovarianJavaOverride.kt") public void testSuspendCovarianJavaOverride() throws Exception { @@ -33006,18 +32994,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/coroutines/release"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } - @Test - @TestMetadata("coroutineContext.kt") - public void testCoroutineContext() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/release/coroutineContext.kt"); - } - - @Test - @TestMetadata("languageVersionIsNotEqualToApiVersion.kt") - public void testLanguageVersionIsNotEqualToApiVersion() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/release/languageVersionIsNotEqualToApiVersion.kt"); - } - @Test @TestMetadata("suspend.kt") public void testSuspend() throws Exception { @@ -33058,12 +33034,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/notRelatedFun.kt"); } - @Test - @TestMetadata("outerYield_1_2.kt") - public void testOuterYield_1_2() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.kt"); - } - @Test @TestMetadata("outerYield_1_3.kt") public void testOuterYield_1_3() throws Exception { @@ -33204,12 +33174,6 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest { runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/localFunctions.kt"); } - @Test - @TestMetadata("nothingTypedSuspendFunction_1_2.kt") - public void testNothingTypedSuspendFunction_1_2() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction_1_2.kt"); - } - @Test @TestMetadata("nothingTypedSuspendFunction_1_3.kt") public void testNothingTypedSuspendFunction_1_3() throws Exception { diff --git a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java index 33db9111fc8..2df1ed4ac7a 100644 --- a/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java +++ b/compiler/tests-common-new/tests-gen/org/jetbrains/kotlin/test/runners/FirOldFrontendDiagnosticsTestGenerated.java @@ -32331,18 +32331,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineOrReturn_1_2.kt"); } - @Test - @TestMetadata("suspendCoroutineUnavailableWithNewAPI.kt") - public void testSuspendCoroutineUnavailableWithNewAPI() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithNewAPI.kt"); - } - - @Test - @TestMetadata("suspendCoroutineUnavailableWithOldAPI.kt") - public void testSuspendCoroutineUnavailableWithOldAPI() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/suspendCoroutineUnavailableWithOldAPI.kt"); - } - @Test @TestMetadata("suspendCovarianJavaOverride.kt") public void testSuspendCovarianJavaOverride() throws Exception { @@ -32910,18 +32898,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/coroutines/release"), Pattern.compile("^(.+)\\.kt$"), Pattern.compile("^(.+)\\.fir\\.kts?$"), true); } - @Test - @TestMetadata("coroutineContext.kt") - public void testCoroutineContext() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/release/coroutineContext.kt"); - } - - @Test - @TestMetadata("languageVersionIsNotEqualToApiVersion.kt") - public void testLanguageVersionIsNotEqualToApiVersion() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/release/languageVersionIsNotEqualToApiVersion.kt"); - } - @Test @TestMetadata("suspend.kt") public void testSuspend() throws Exception { @@ -32962,12 +32938,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/notRelatedFun.kt"); } - @Test - @TestMetadata("outerYield_1_2.kt") - public void testOuterYield_1_2() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/restrictSuspension/outerYield_1_2.kt"); - } - @Test @TestMetadata("outerYield_1_3.kt") public void testOuterYield_1_3() throws Exception { @@ -33108,12 +33078,6 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/localFunctions.kt"); } - @Test - @TestMetadata("nothingTypedSuspendFunction_1_2.kt") - public void testNothingTypedSuspendFunction_1_2() throws Exception { - runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction_1_2.kt"); - } - @Test @TestMetadata("nothingTypedSuspendFunction_1_3.kt") public void testNothingTypedSuspendFunction_1_3() throws Exception {