In bytecode, does a `suspend fun` only ever return...
# announcements
l
In bytecode, does a
suspend fun
only ever return a
java/lang/Object
? Can't seem to make it typed.
m
Yes, because it will return a special value in case the function gets suspended. Would it be type then coroutines won’t work at all.
l
OK, thank you. So when writing Java interop with Kotlin suspend functions, I'll just have to cast the object as my class?
m
Unfortunately it’s not that simple. I suggest looking online for various options how you can interface with Kotlin coroutines from Java code.
k
You probably want a wrapper function in Kotlin