Forbid coroutines in language version is 1.3 and api version is less

This commit is contained in:
Ilmir Usmanov
2018-07-09 22:02:33 +03:00
parent 03c50ea139
commit c460593b7d
8 changed files with 72 additions and 8 deletions
@@ -1,3 +1,4 @@
// !API_VERSION: 1.3
// !LANGUAGE: +ReleaseCoroutines
// SKIP_TXT
@@ -0,0 +1,32 @@
// !API_VERSION: 1.2
// !DIAGNOSTICS: -PRE_RELEASE_CLASS
// !LANGUAGE: +ReleaseCoroutines
// SKIP_TXT
suspend fun dummy() {}
suspend fun test1() {
kotlin.coroutines.<!UNRESOLVED_REFERENCE!>coroutineContext<!>
kotlin.coroutines.experimental.<!UNSUPPORTED, UNSUPPORTED!>coroutineContext<!>
<!UNSUPPORTED!>suspend {}()<!>
<!UNSUPPORTED!>dummy<!>()
val c: suspend () -> Unit = {}
<!UNSUPPORTED!>c<!>()
}
fun test2() {
kotlin.coroutines.experimental.buildSequence<Int> {
yield(1<!NO_VALUE_FOR_PARAMETER!>)<!>
}
kotlin.sequences.<!UNRESOLVED_REFERENCE!>buildSequence<!><Int> {
<!UNRESOLVED_REFERENCE!>yield<!>(1)
}
}
suspend fun test3(): Unit = <!TYPE_MISMATCH!>kotlin.coroutines.experimental.<!NO_VALUE_FOR_PARAMETER, TYPE_INFERENCE_PARAMETER_CONSTRAINT_ERROR!>suspendCoroutine<!> <!TYPE_MISMATCH!>{ <!CANNOT_INFER_PARAMETER_TYPE!>_<!> -> Unit }<!><!>
suspend fun test4(): Unit = kotlin.coroutines.<!UNRESOLVED_REFERENCE!>suspendCoroutine<!> { <!CANNOT_INFER_PARAMETER_TYPE!>_<!> -> Unit }
@@ -1,3 +1,4 @@
// !API_VERSION: 1.3
// !LANGUAGE: +ReleaseCoroutines
// SKIP_TXT