Skip to content

Commit b8d6c7f

Browse files
committed
Disfavor the older next() APIs on TaskGroup
1 parent f85eed4 commit b8d6c7f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

stdlib/public/Concurrency/TaskGroup.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ public struct TaskGroup<ChildTaskResult: Sendable> {
575575
}
576576

577577
@available(SwiftStdlib 5.1, *)
578+
@_disfavoredOverload
578579
public mutating func next() async -> ChildTaskResult? {
579580
// try!-safe because this function only exists for Failure == Never,
580581
// and as such, it is impossible to spawn a throwing child task.
@@ -1034,6 +1035,7 @@ public struct ThrowingTaskGroup<ChildTaskResult: Sendable, Failure: Error> {
10341035
}
10351036

10361037
@available(SwiftStdlib 5.1, *)
1038+
@_disfavoredOverload
10371039
public mutating func next() async throws -> ChildTaskResult? {
10381040
return try await _taskGroupWaitNext(group: _group)
10391041
}

0 commit comments

Comments
 (0)