Skip to content

Commit 5a1c268

Browse files
committed
Add test for ThrowingTaskGroup version
1 parent c5a77fc commit 5a1c268

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

test/Concurrency/async_sequence_macosx.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,18 @@ func f<S: AsyncSequence>(s: S) async throws {
1818
// Make sure we don't complain about crossing a concurrency boundary here.
1919
@MainActor
2020
class Store<Action: Sendable> {
21-
private func intercept(_ action: Action) async {
21+
private func intercept(_ action: Action) async throws {
2222
await withTaskGroup(of: Optional<Action>.self) { group in
2323
for await case let nextAction? in group {
2424
_ = nextAction
2525
}
2626
}
27+
28+
try await withThrowingTaskGroup(of: Optional<Action>.self) { group in
29+
for try await case let nextAction? in group {
30+
_ = nextAction
31+
}
32+
}
33+
2734
}
2835
}

0 commit comments

Comments
 (0)