Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardSwiftstructured concurrency task treesSingle-choice MCQ

What is the precise behavior of `Task.isCancelled` checked inside a detached task (`Task.detached`) that was created from within a cancelled parent task?

let parent = Task { let child = Task.detached { return Task.isCancelled } return await child.value } parent.cancel()