``` class MainDispatcher: CoroutineDispatcher() { ...
# kotlin-native
y
Copy code
class MainDispatcher: CoroutineDispatcher() {
    override fun dispatch(context: CoroutineContext, block: Runnable) {
        dispatch_async(dispatch_get_main_queue()) { block.run() }
    }
}
o
Could you please post self-containing reproducer somewhere?
y
Here, I prepared simple reproducer for this.
👍 1
o
any reasons why your
callDelay
doesn’t do smth like
runBlocking {  delay(1000L) }
?
y
Nothing special.
I can use delay with
runBlocking
, but not with the
MainScope
. I just wanted to know why.
Moreover, the reason is
TypeCastException
.
Maybe, is it related with
KotlinLong
Objective-C type? not Kotlin.Long. This is just my conjecture
o
if you just put
delay
and
println
to
runBlocking
it behaves as expected, so it’s likely misleading diagnostics of calling blocking function delay in wrong context
y
thank you 🙏
e
Can you, please, file an issue to https://github.com/Kotlin/kotlinx.coroutines/issues
👍 1
y