Skip to content

CoroutineScope.ensureActive() documentation #2241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tanmatra opened this issue Sep 10, 2020 · 1 comment
Closed

CoroutineScope.ensureActive() documentation #2241

tanmatra opened this issue Sep 10, 2020 · 1 comment
Assignees

Comments

@tanmatra
Copy link

The docs state what it "Throws IllegalStateException if the context does not have a job in it"
https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/common/src/CoroutineScope.kt#L229
But it delegates to CoroutineContext.ensureActive(), for which "This function does not do anything if there is no Job in the context"
https://github.com/Kotlin/kotlinx.coroutines/blob/master/kotlinx-coroutines-core/common/src/Job.kt#L593

@elizarov elizarov self-assigned this Sep 11, 2020
elizarov added a commit that referenced this issue Sep 11, 2020
This is leftover from #2044 fix.

Fixes #2241
@elizarov
Copy link
Contributor

Good catch. Thanks

recheej pushed a commit to recheej/kotlinx.coroutines that referenced this issue Dec 28, 2020
recheej pushed a commit to recheej/kotlinx.coroutines that referenced this issue Dec 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants