Is there a proposal to allow `fun interface`s to b...
# language-proposals
x
Is there a proposal to allow `fun interface`s to be suspended?
1
y
It works? (Playground):
Copy code
suspend fun main() {
    val kotlin = SuspendRunnable { "kotlin" }
    println(kotlin.run())
}
fun interface SuspendRunnable<R> {
    suspend fun run(): R
}
What version of kotlin are you using?
x
yea you are right - looks like this was added in a recent version
e
https://youtrack.jetbrains.com/issue/KT-44787 it was only broken in the old JVM backend, which was a while ago