Implement correct is check for SuspendFunction

Add test for suspend functions with language version 1.2.
Minor edit in SuspendFunction docs.
This commit is contained in:
Ilmir Usmanov
2018-08-10 20:22:06 +03:00
committed by Ilya Gorbunov
parent a205019156
commit fe451dce31
7 changed files with 49 additions and 5 deletions
@@ -0,0 +1,19 @@
// 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"
}