withContext
may execute code in the wrong context if the coroutineContext
misleads it
#4193
Labels
withContext
may execute code in the wrong context if the coroutineContext
misleads it
#4193
Describe the bug
Encountered by the IntelliJ team.
withContext
looks at the current coroutine context and decides whether it should perform a dispatch. However, the current coroutine context does not always correctly reflect which thread the coroutine executes on. So,withContext
may believe that it doesn't have to dispatch when it actually does.Provide a Reproducer
(https://pl.kotl.in/POeZD53Uw) prints
which is not a
Dispatchers.Default
thread.The text was updated successfully, but these errors were encountered: