if I compile kotlin code with coroutine to jar, ca...
# announcements
i
if I compile kotlin code with coroutine to jar, can I run it with java?
t
If the code using coroutines code is only called from Kotlin, then it is completely fine. Coroutines are not quite compatible with Java, as Java lacks the
suspend
keyword. In compiled Kotlin code, each
suspend fun
is converted this way :
Copy code
suspend fun <T, R> foo(input: T): R
becomes
Copy code
<T, R> Object foo(T input, Continuation<? super R> cont)
in Java.