Allow calling some pieces of the experimental coroutine API
- Calling suspend functions is allowed - Presence of suspend function type still makes declaration unusable unless it belongs to a value parameter as a top-level type containing less then three parameters Still, warning should be emitted because they will become unsupported in 1.4 #KT-25683 In Progress
This commit is contained in:
+7
-20
@@ -1,27 +1,14 @@
|
||||
suspend fun dummy() {}
|
||||
|
||||
class C {
|
||||
suspend fun dummy() = "OK"
|
||||
}
|
||||
|
||||
class WithNested {
|
||||
class Nested {
|
||||
suspend fun dummy() = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
class WithInner {
|
||||
inner class Inner {
|
||||
suspend fun dummy() = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
val c: suspend () -> Unit = {}
|
||||
|
||||
class WithTypeParameter<T: suspend() -> Unit> {}
|
||||
|
||||
fun returnsSuspend() : suspend() -> Unit = {}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {}
|
||||
fun <T: suspend () -> Unit> withTypeParameter() = {}
|
||||
|
||||
fun <T: suspend () -> Unit> withTypeParameter() = {}
|
||||
fun suspendFunctionNested(x: List<suspend () -> Unit>) {}
|
||||
fun suspendFunctionNestedInFunctionType(x: (suspend () -> Unit) -> Unit) {}
|
||||
|
||||
fun suspendFunctionType3(x: suspend (Int, Int, Int) -> Unit) {}
|
||||
|
||||
fun suspendVarargs(vararg x: suspend () -> Unit) {}
|
||||
|
||||
Reference in New Issue
Block a user