Introduce keys to control applicability of coroutines
By default now we produce warnings on coroutines
This commit is contained in:
committed by
Stanislav Erokhin
parent
30710955dc
commit
664485f4bb
@@ -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
|
||||
+18
@@ -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
|
||||
}
|
||||
+5
@@ -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
|
||||
Reference in New Issue
Block a user