question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`Delay` function throws TypeCastException.

See original GitHub issue

The delay suspend function throws TypeCastException when called from Swift.

The Condition.

  • preparing CoroutineDispatcher for main queue.
  • launch coroutines using the dispatcher.

I prepared self-containing repository here. https://github.com/horita-yuya/TempKotlinNativeReport kotlinx.coroutines version: 1.1.0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
elizarovcommented, Mar 15, 2019

@pardom You don’t need to block if you are using coroutines on the main (UI) thread in iOS, but you’ll need to write the corresponding dispatcher. See here: #470 Does it help?

0reactions
pardomcommented, Mar 14, 2019

Not sure if this is my issue exactly, but I was linked here from https://github.com/JetBrains/kotlin-native/issues/2752 in response to a bug manifested in https://github.com/pardom/oolong/pull/16. The project does not call delay as @qwwdfsad mentions above, but it also doesn’t call runBlocking because I have no need to block and I also want to support all platforms.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Kotlin coroutine delay() function causes java.lang ...
In the coroutine, when I use the delay() function to pause for 10 seconds, I get the below error. When I remove the...
Read more >
Invalid return type when testing Async methods - Telerik
I have 2 classes Parent and a Child class, child class inherits from parent. Class under test has an async method that returns...
Read more >
Test Spring WebClient with MockWebServer from OkHttp
Method.invoke(Method.java:566). Caused by: java.lang.ClassNotFoundException: kotlin.TypeCastException. at java.base/jdk.internal.loader.
Read more >
How can I make a fake player sleep? - SpigotMC
fauxSleeping = true does nothing, and npc.sleep throws an error. What I want it the faux player to go into the sleep position....
Read more >
Functional type with let - unresolved reference: invoke-kotlin
Coding example for the question Functional type with let - unresolved reference: ... Inline function with reified generic throws illegal type variable ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found