mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
The concurrency runtime now deploys back to macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, which corresponds to the 5.1 release of the stdlib. Adjust macro usages accordingly.
22 lines
576 B
Swift
22 lines
576 B
Swift
// RUN: %target-swift-frontend -emit-ir %s
|
|
// REQUIRES: concurrency
|
|
|
|
private struct TransformResult<T> {
|
|
var index: Int
|
|
var transformedElement: T
|
|
|
|
init(index: Int, transformedElement: T) {
|
|
self.index = index
|
|
self.transformedElement = transformedElement
|
|
}
|
|
}
|
|
|
|
public extension Collection {
|
|
@available(SwiftStdlib 5.1, *)
|
|
private func f<T>(_ transform: @escaping (Element) async throws -> T) async throws -> [T] {
|
|
return try await withThrowingTaskGroup(of: TransformResult<T>.self) { group in
|
|
return []
|
|
}
|
|
}
|
|
}
|