Hello,
I have the following code:
suspend fun test(f: suspend () -> Unit) {
f()
}
fun test(f: () -> Unit) {
f()
}
fun main() {
// Compile error below!
test {
delay(1000)
}
}
Unfortunately, this does not compile. The compiler is not able to deduce that the lambda must be suspendable, because it calls a suspending function.
In my case, I can’t have a single inline
function, because of technical reasons that prevent inlining.
Is it possible to support this by the compiler?
Thanks