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:
Mikhail Zarechenskiy
2019-08-21 16:34:25 +03:00
parent 5e3a11db8e
commit 80fa591f10
4 changed files with 6 additions and 46 deletions
@@ -1,9 +1,8 @@
// !LANGUAGE: -NewInference
// !WITH_NEW_INFERENCE
// SKIP_TXT
// WITH_RUNTIME
// COMMON_COROUTINES_TEST
import COROUTINES_PACKAGE.*
import kotlin.coroutines.*
interface Job : CoroutineContext.Element {}
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<!>()
}
}