Move SuspendFunction{N} interfaces to kotlin.coroutines package
#KT-25824: Fixed
This commit is contained in:
+1
@@ -7,6 +7,7 @@
|
||||
|
||||
// FILE: test.kt
|
||||
import kotlin.reflect.KSuspendFunction0
|
||||
import kotlin.coroutines.SuspendFunction0
|
||||
|
||||
class Test {
|
||||
suspend fun o() = "O"
|
||||
|
||||
-19
@@ -1,19 +0,0 @@
|
||||
// IGNORE_BACKEND: JS_IR, JS
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// LANGUAGE_VERSION: 1.2
|
||||
|
||||
import helpers.*
|
||||
import kotlin.coroutines.*
|
||||
|
||||
val lambda1 = { x: Any -> } as (Any) -> Unit
|
||||
val suspendLambda0: suspend () -> Unit = {}
|
||||
|
||||
fun box(): String {
|
||||
assert(lambda1 is SuspendFunction0<*>) { "Failed: lambda1 !is SuspendFunction0<*>" }
|
||||
assert(suspendLambda0 is Function1<*, *>) { "Failed: suspendLambda0 is Function1<*, *>" }
|
||||
assert(suspendLambda0 is SuspendFunction0<*>) { "Failed: suspendLambda0 is SuspendFunction0<*>" }
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+6
@@ -21,6 +21,10 @@ class A {
|
||||
suspend fun suspendFoo() {}
|
||||
}
|
||||
|
||||
inline fun <reified T : suspend () -> Unit> checkReified(noinline x: (Any?) -> Unit) {
|
||||
if(x is T) throw IllegalStateException("x is T")
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val f1 = ::fn1 as Any
|
||||
val sf0 = ::suspendFn0 as Any
|
||||
@@ -57,5 +61,7 @@ fun box(): String {
|
||||
assert(safoo is Function2<*, *, *>) { "safoo is Function2<*, *, *>" }
|
||||
assert(safoo is SuspendFunction1<*, *>) { "asfoo is SuspendFunction1<*, *>" }
|
||||
|
||||
checkReified<suspend () -> Unit> {}
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Reference in New Issue
Block a user