FIC: support suspend conversions in jvm codegen

This commit is contained in:
Mikhail Zarechenskiy
2019-12-17 16:27:44 +03:00
parent b98d8bd7c1
commit 70094884ca
8 changed files with 55 additions and 4 deletions
@@ -0,0 +1,25 @@
// !LANGUAGE: +NewInference +FunctionInterfaceConversion +SamConversionPerArgument +SamConversionForKotlinFunctions
// WITH_COROUTINES
// WITH_RUNTIME
import helpers.*
import kotlin.coroutines.startCoroutine
fun interface SuspendRunnable {
suspend fun invoke()
}
fun run(r: SuspendRunnable) {
r::invoke.startCoroutine(EmptyContinuation)
}
var result = "initial"
suspend fun bar() {
result = "OK"
}
fun box(): String {
run(::bar)
return result
}