JVM_IR: Support is/as SuspendFunction operators

This commit is contained in:
Ilmir Usmanov
2019-10-10 20:46:02 +03:00
parent 6f47699796
commit 5eeb2958f7
7 changed files with 34 additions and 30 deletions
@@ -17,26 +17,26 @@ fun test(f: Function<*>, arity: Int) {
}
suspend fun foo(s: String, i: Int) {}
//class A {
// suspend fun bar(s: String, i: Int) {}
//}
//
//suspend fun Double.baz(s: String, i: Int) {}
class A {
suspend fun bar(s: String, i: Int) {}
}
suspend fun Double.baz(s: String, i: Int) {}
fun box(): String {
test(::foo, 2 + 1)
// test(A::bar, 3 + 1)
// test(Double::baz, 3 + 1)
//
// test(::box, 0)
//
// suspend fun local(x: Int) {}
// test(::local, 1 + 1)
//
// // TODO: Uncomment when `suspend fun` will be supported
// // test(suspend fun(s: String) = s, 1)
// // test(suspend fun(){}, 0)
// test(suspend {}, 1)
test(A::bar, 3 + 1)
test(Double::baz, 3 + 1)
test(::box, 0)
suspend fun local(x: Int) {}
test(::local, 1 + 1)
// TODO: Uncomment when `suspend fun` will be supported
// test(suspend fun(s: String) = s, 1)
// test(suspend fun(){}, 0)
test(suspend {}, 1)
return "OK"
}
@@ -1,6 +1,5 @@
// IGNORE_BACKEND: NATIVE
// IGNORE_BACKEND: JS_IR, JS
// IGNORE_BACKEND: JVM_IR
// WITH_RUNTIME
// WITH_COROUTINES