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

A parent task uses `withTaskGroup` and adds three child tasks, but the body returns after awaiting only the first result via `group.next()`. Under structured concurrency rules, what happens to the two child tasks that were never awaited when the group scope exits?

await withTaskGroup(of: Int.self) { group in group.addTask { await work(1) } group.addTask { await work(2) } group.addTask { await work(3) } return await group.next()! }