Skip to content

Commit d9fac04

Browse files
committed
[Concurrency] Additional test for task group body isolation inheritance
1 parent db0367b commit d9fac04

File tree

2 files changed

+27
-20
lines changed

2 files changed

+27
-20
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// RUN: %target-swift-frontend -emit-sil -verify -o /dev/null -disable-availability-checking %s -swift-version 6 -strict-concurrency=complete
2+
3+
// REQUIRES: concurrency
4+
// REQUIRES: asserts
5+
6+
actor A {
7+
func g() { }
8+
func h() throws { }
9+
10+
func f() async throws {
11+
await withTaskGroup(of: Int.self, returning: Void.self) { group in
12+
self.g()
13+
}
14+
15+
try await withThrowingTaskGroup(of: String.self, returning: Void.self) { group in
16+
try self.h()
17+
}
18+
19+
await withDiscardingTaskGroup(returning: Void.self) { group in
20+
self.g()
21+
}
22+
23+
try await withThrowingDiscardingTaskGroup(returning: Void.self) { group in
24+
try self.h()
25+
}
26+
}
27+
}

test/Concurrency/unsafe_inherit_executor_lib.swift

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)