How to construct a CoroutineScope in Java? I’m fac...
# coroutines
f
How to construct a CoroutineScope in Java? I’m facing this error:
k
Coroutines are a language level feature in Kotlin. You can't expect to be able to use them in Java.
f
Yeah. But function and type are not language level features. So why doesn’t my code work? 🤔
d
This is indeed strange.
MainCoroutineDispatcher
is a
CoroutineDispatcher
, which is a
ContinuationInterceptor
, which is a
CoroutineContext.Element
, which is a
CoroutineContext
. Maybe the problem is just with the IDE and the code actually works? Did you try to compile it anyway?
f
You’re right. It’s with the IDE. The build can pass.