Skip to content

CoroutineScope.ensureActive() documentation #2241

Closed
@tanmatra

Description

@tanmatra

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions