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<!>()
}
}