Minor. Add regression test for KT-18292

#KT-18292: Obsolete
This commit is contained in:
Ilmir Usmanov
2018-02-20 20:20:00 +03:00
parent a0186224b2
commit bcf29d106d
3 changed files with 30 additions and 0 deletions
@@ -0,0 +1,18 @@
// SKIP_TXT
// WITH_RUNTIME
import kotlin.coroutines.experimental.*
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!>fib(n - 1)<!>.<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>await<!>() <!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>+<!> fib(n - 2).<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>await<!>()
}
}
@@ -1320,6 +1320,12 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
doTest(fileName);
}
@TestMetadata("kt18292.kt")
public void testKt18292() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt");
doTest(fileName);
}
@TestMetadata("lambdaExpectedType.kt")
public void testLambdaExpectedType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.kt");
@@ -1320,6 +1320,12 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
doTest(fileName);
}
@TestMetadata("kt18292.kt")
public void testKt18292() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/kt18292.kt");
doTest(fileName);
}
@TestMetadata("lambdaExpectedType.kt")
public void testLambdaExpectedType() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/coroutines/lambdaExpectedType.kt");