Split 'nothingTypedSuspendFunction' test into two separate tests (for old and new coroutines)

This commit is contained in:
victor.petukhov
2019-03-16 21:39:44 +03:00
parent 29493a4977
commit 9a2178d96b
6 changed files with 22 additions and 11 deletions
@@ -0,0 +1,9 @@
// !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 = <!IMPLICIT_NOTHING_AS_TYPE_PARAMETER!>suspendCoroutineUninterceptedOrReturn<!> { c ->
c.resumeWithException(exception)
COROUTINE_SUSPENDED
}
@@ -1,7 +1,6 @@
// Tail calls are not allowed to be Nothing typed. See KT-15051
// COMMON_COROUTINES_TEST
import COROUTINES_PACKAGE.*
import COROUTINES_PACKAGE.intrinsics.*
import kotlin.coroutines.*
import kotlin.coroutines.intrinsics.*
suspend fun suspendLogAndThrow(exception: Throwable): Nothing = <!IMPLICIT_NOTHING_AS_TYPE_PARAMETER!>suspendCoroutineUninterceptedOrReturn<!> { c ->
c.<!IMPLICIT_NOTHING_AS_TYPE_PARAMETER!>resumeWithException<!>(exception)
@@ -0,0 +1,3 @@
package
public suspend fun suspendLogAndThrow(/*0*/ exception: kotlin.Throwable): kotlin.Nothing
@@ -2294,14 +2294,14 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/localFunctions.kt");
}
@TestMetadata("nothingTypedSuspendFunction.kt")
@TestMetadata("nothingTypedSuspendFunction_1_2.kt")
public void testNothingTypedSuspendFunction_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt", "kotlin.coroutines.experimental");
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction_1_2.kt");
}
@TestMetadata("nothingTypedSuspendFunction.kt")
@TestMetadata("nothingTypedSuspendFunction_1_3.kt")
public void testNothingTypedSuspendFunction_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt", "kotlin.coroutines");
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction_1_3.kt");
}
@TestMetadata("recursive.kt")
@@ -2294,14 +2294,14 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/localFunctions.kt");
}
@TestMetadata("nothingTypedSuspendFunction.kt")
@TestMetadata("nothingTypedSuspendFunction_1_2.kt")
public void testNothingTypedSuspendFunction_1_2() throws Exception {
runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt", "kotlin.coroutines.experimental");
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction_1_2.kt");
}
@TestMetadata("nothingTypedSuspendFunction.kt")
@TestMetadata("nothingTypedSuspendFunction_1_3.kt")
public void testNothingTypedSuspendFunction_1_3() throws Exception {
runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction.kt", "kotlin.coroutines");
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/tailCalls/nothingTypedSuspendFunction_1_3.kt");
}
@TestMetadata("recursive.kt")