Skip to content

Inconsistent behavior between withContext and withTimeout/coroutineScope/supervisorScope if the caller is cancelled before the start #4457

Open
@dkhalanskyjb

Description

@dkhalanskyjb
runBlocking {
    cancel()
    withContext(EmptyCoroutineContext) {
        println("This will not be printed")
    }
    println("Neither will this")
}
runBlocking {
    cancel()
    withTimeout(1.seconds) {
        println("This will be printed")
    }
    println("This will not")
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions