Fix failing test because of slightly different diagnostics for LV=1.2
There are no `DEBUG_INFO_MISSING_UNRESOLVED` diagnostics for this test if one runs it under LV=1.2. These diagnostics are not crucial for the test (especially for version 1.2), so use it only with the latest stable version Plus, reuse test-data to check behavior in new inference
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
// !LANGUAGE: -NewInference
|
// !WITH_NEW_INFERENCE
|
||||||
// SKIP_TXT
|
// SKIP_TXT
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// COMMON_COROUTINES_TEST
|
|
||||||
|
|
||||||
import COROUTINES_PACKAGE.*
|
import kotlin.coroutines.*
|
||||||
|
|
||||||
interface Job : CoroutineContext.Element {}
|
interface Job : CoroutineContext.Element {}
|
||||||
interface Deferred<out T> : Job {
|
interface Deferred<out T> : Job {
|
||||||
|
|||||||
@@ -1,19 +0,0 @@
|
|||||||
// !LANGUAGE: +NewInference
|
|
||||||
// SKIP_TXT
|
|
||||||
// WITH_RUNTIME
|
|
||||||
|
|
||||||
import kotlin.coroutines.*
|
|
||||||
|
|
||||||
interface Job : CoroutineContext.Element {}
|
|
||||||
interface Deferred<out T> : Job {
|
|
||||||
suspend fun await(): T
|
|
||||||
}
|
|
||||||
fun <T> async(<!UNUSED_PARAMETER!>block<!>: suspend () -> T): Deferred<T> = TODO()
|
|
||||||
|
|
||||||
suspend fun fib(n: Long) =
|
|
||||||
async {
|
|
||||||
when {
|
|
||||||
n < 2 -> n
|
|
||||||
else -> <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!><!DEBUG_INFO_MISSING_UNRESOLVED!>fib<!>(<!DEBUG_INFO_MISSING_UNRESOLVED!>n<!> <!DEBUG_INFO_MISSING_UNRESOLVED!>-<!> 1)<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>await<!>() <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>+<!> fib(n - 2).<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>await<!>()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
+2
-12
@@ -1544,18 +1544,8 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
|||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt18292.kt")
|
@TestMetadata("kt18292.kt")
|
||||||
public void testKt18292_1_2() throws Exception {
|
public void testKt18292() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt", "kotlin.coroutines.experimental");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt");
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("kt18292.kt")
|
|
||||||
public void testKt18292_1_3() throws Exception {
|
|
||||||
runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt", "kotlin.coroutines");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("kt18292_ni.kt")
|
|
||||||
public void testKt18292_ni() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292_ni.kt");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt28658.kt")
|
@TestMetadata("kt28658.kt")
|
||||||
|
|||||||
compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java
Generated
+2
-12
@@ -1544,18 +1544,8 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
|
|||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt18292.kt")
|
@TestMetadata("kt18292.kt")
|
||||||
public void testKt18292_1_2() throws Exception {
|
public void testKt18292() throws Exception {
|
||||||
runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt", "kotlin.coroutines.experimental");
|
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt");
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("kt18292.kt")
|
|
||||||
public void testKt18292_1_3() throws Exception {
|
|
||||||
runTestWithPackageReplacement("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt", "kotlin.coroutines");
|
|
||||||
}
|
|
||||||
|
|
||||||
@TestMetadata("kt18292_ni.kt")
|
|
||||||
public void testKt18292_ni() throws Exception {
|
|
||||||
runTest("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292_ni.kt");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("kt28658.kt")
|
@TestMetadata("kt28658.kt")
|
||||||
|
|||||||
Reference in New Issue
Block a user