You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's a bit odd that cancelled scopes can be reused.
Example
val scope = CoroutineScope(Dispatchers.Unconfined + Job())
scope.launch { println("hello!") }
scope.coroutineContext[Job]!!.cancel()
// I expect this not to print, because the scope has been cancelled
scope.launch { println("goodbye!") }
Expected
hello!
Actual
hello!
goodbye!
EDIT: It seems the issue is that before launching a coroutine, the launch does not check if the scope has been cancelled or not:
This happens because you are using Dispatchers.Unconfined. Please, don't use Dispatchers.Unconfined it may result is other weird and unexplicable behaviors, beyond the one you had demonstrated.
It's a bit odd that cancelled scopes can be reused.
Example
Expected
Actual
EDIT: It seems the issue is that before launching a coroutine, the launch does not check if the scope has been cancelled or not:
yield example
result
Is this intentional?
The text was updated successfully, but these errors were encountered: