pandawarrior
04/01/2019, 10:12 AMkotlin.TypeCastException
while using coroutine’s async/await
in common
when running on iOS. But it works well on Android. Any advice to go about this?svyatoslav.scherbina
04/01/2019, 10:19 AMpandawarrior
04/02/2019, 3:04 AMdelay
caused TypeCastException
but it is actually IllegalStateException
because the dispatcher doesn’t implement the Delay interface.
So we will have to implement the Deferred<Unit> (Generic is not available K/N) in to a custom dispatcher class?
Are there any examples to go about it?svyatoslav.scherbina
04/02/2019, 6:09 AMThanks, I saw the closed issue about usingCould you clarify, do you encountercauseddelay
but it is actuallyTypeCastException
because the dispatcher doesn’t implement the Delay interface.IllegalStateException
TypeCastException
or IllegalStateException
?
So we will have to implement the Deferred<Unit> (Generic is not available K/N) in to a custom dispatcher class?How is
Deferred
related?pandawarrior
04/02/2019, 6:31 AM>> Could you clarify, do you encounterI encounteredorTypeCastException
?IllegalStateException
kotlin.TypeCastException
when using async/await
in commonMain
>> How ishttps://github.com/Kotlin/kotlinx.coroutines/issues/470, The temporary solution to solvingrelated?Deferred
TypeCastException
for using delay
is to implement Delay
to the class subclassing CoroutineDispatcher()
. So if I am not mistaken, the problem to TypeCastException
to using async/await
is the implementation of the Deferred
interface in class that subclass CoroutineDispatcher()
.svyatoslav.scherbina
04/02/2019, 6:49 AMDeferred
or Delay
?
Are there any examples to go about it?I believe there is one in the comments to the issue.