Introduce keys to control applicability of coroutines

By default now we produce warnings on coroutines
This commit is contained in:
Mikhail Zarechenskiy
2016-12-14 15:22:41 +03:00
committed by Stanislav Erokhin
parent 30710955dc
commit 664485f4bb
25 changed files with 228 additions and 10 deletions
@@ -0,0 +1,18 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !LANGUAGE: +ErrorOnCoroutines
<!EXPERIMENTAL_FEATURE_ERROR!>suspend<!> fun suspendHere(): String = "OK"
fun builder(c: suspend () -> Unit) {
}
fun box(): String {
var result = ""
<!EXPERIMENTAL_FEATURE_ERROR!>builder<!> {
suspendHere()
}
return result
}
@@ -0,0 +1,5 @@
package
public fun box(): kotlin.String
public fun builder(/*0*/ c: suspend () -> kotlin.Unit): kotlin.Unit
public suspend fun suspendHere(): kotlin.String
@@ -0,0 +1,18 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER
// !LANGUAGE: +WarnOnCoroutines
<!EXPERIMENTAL_FEATURE_WARNING!>suspend<!> fun suspendHere(): String = "OK"
fun builder(c: suspend () -> Unit) {
}
fun box(): String {
var result = ""
<!EXPERIMENTAL_FEATURE_WARNING!>builder<!> {
suspendHere()
}
return result
}
@@ -0,0 +1,5 @@
package
public fun box(): kotlin.String
public fun builder(/*0*/ c: suspend () -> kotlin.Unit): kotlin.Unit
public suspend fun suspendHere(): kotlin.String