Hi everyone, I'm trying to create a GtkDispatcher ...
# coroutines
r
Hi everyone, I'm trying to create a GtkDispatcher for some Kotlin/Native bindings that I'm working on, but I'm stuck in injecting the dispatched as the Main one. It works fine on tests if I use
kotlinx.coroutines.test.setMain
but on main, when I try to use
Dispatchers.injectMain()
the build fails with
Cannot access 'fun injectMain(dispatcher: MainCoroutineDispatcher): Unit': it is internal in 'kotlinx/coroutines/Dispatchers'.
Is there something that I have to opt-in?
d
Hi! We just don't provide this functionality. You could suppress the error like we do here: https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-test/native/src/internal/TestMainDispatcher.kt This could stop working at any moment, though. If you want proper support for this, please file an issue: https://github.com/Kotlin/kotlinx.coroutines/issues
r
hi, thank you,
@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE")
did the trick, but I'll file an issue to have proper support