Skip to content

Commit 6bfef94

Browse files
committed
[docs][Concurrency] Include required parameter in group docs
[docs][Concurrency] Fix typo in method signature in code snippets of groups
1 parent cdcba01 commit 6bfef94

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

stdlib/public/Concurrency/DiscardingTaskGroup.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import Swift
3535
/// before returning from this function:
3636
///
3737
/// ```
38-
/// await withDiscardingTaskGroup { group in
38+
/// await withDiscardingTaskGroup(...) { group in
3939
/// group.addTask { /* slow-task */ }
4040
/// // slow-task executes...
4141
/// }
@@ -357,7 +357,7 @@ extension DiscardingTaskGroup: Sendable { }
357357
/// before returning from this function:
358358
///
359359
/// ```
360-
/// try await withThrowingDiscardingTaskGroup { group in
360+
/// try await withThrowingDiscardingTaskGroup(of: Void.self) { group in
361361
/// group.addTask { /* slow-task */ }
362362
/// // slow-task executes...
363363
/// }
@@ -390,7 +390,7 @@ extension DiscardingTaskGroup: Sendable { }
390390
///
391391
/// ```
392392
/// // ThrowingTaskGroup, pattern not applicable to ThrowingDiscardingTaskGroup
393-
/// try await withThrowingTaskGroup { group in
393+
/// try await withThrowingTaskGroup(of: Void.self) { group in
394394
/// group.addTask { try boom() }
395395
/// try await group.next() // re-throws "boom"
396396
/// }

stdlib/public/Concurrency/TaskGroup.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ using FutureFragment = AsyncTask::FutureFragment;
8989

9090
/// During evolution discussions we opted to implement the following semantic of
9191
/// a discarding task-group throw:
92-
/// - the error thrown out of withThrowingDiscardingTaskGroup { ... } always "wins",
92+
/// - the error thrown out of withThrowingDiscardingTaskGroup(...) { ... } always "wins",
9393
/// even if the group already had an error stored within.
9494
///
9595
/// This is harder to implement, since we have to always store the "first error from children",

0 commit comments

Comments
 (0)