mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
28 lines
670 B
Swift
28 lines
670 B
Swift
// RUN: %target-swift-frontend -emit-sil -verify -o /dev/null -disable-availability-checking %s -swift-version 6 -strict-concurrency=complete
|
|
|
|
// REQUIRES: concurrency
|
|
// REQUIRES: asserts
|
|
|
|
actor A {
|
|
func g() { }
|
|
func h() throws { }
|
|
|
|
func f() async throws {
|
|
await withTaskGroup(of: Int.self, returning: Void.self) { group in
|
|
self.g()
|
|
}
|
|
|
|
try await withThrowingTaskGroup(of: String.self, returning: Void.self) { group in
|
|
try self.h()
|
|
}
|
|
|
|
await withDiscardingTaskGroup(returning: Void.self) { group in
|
|
self.g()
|
|
}
|
|
|
|
try await withThrowingDiscardingTaskGroup(returning: Void.self) { group in
|
|
try self.h()
|
|
}
|
|
}
|
|
}
|