Skip to content

Commit 2467f6a

Browse files
committed
[Concurrency] Task.withGroup can be rethrows
1 parent a4ba865 commit 2467f6a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

stdlib/public/Concurrency/TaskGroup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ extension Task {
6464
resultType: TaskResult.Type,
6565
returning returnType: BodyResult.Type = BodyResult.self,
6666
body: (inout Task.Group<TaskResult>) async throws -> BodyResult
67-
) async throws -> BodyResult {
67+
) async rethrows -> BodyResult {
6868
let task = Builtin.getCurrentAsyncTask()
6969
let _group = _taskGroupCreate(task: task)
7070
var group: Task.Group<TaskResult>! = Task.Group(task: task, group: _group)

test/Concurrency/Runtime/async_taskgroup_throw_recover.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ func boom() async throws -> Int {
1414
}
1515

1616
func test_taskGroup_throws() async {
17-
let got: Int = try! await Task.withGroup(resultType: Int.self) { group in
17+
let got: Int = await Task.withGroup(resultType: Int.self) { group in
1818
await group.add { try await boom() }
1919

2020
do {

0 commit comments

Comments
 (0)