@@ -14,35 +14,35 @@ import StdlibUnittest
1414// Utility functions for closure based operators to force them into throwing
1515// and async and throwing async contexts.
1616
17- @available ( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * )
17+ @available ( SwiftStdlib 5 . 5 , * )
1818func throwing< T> ( _ value: T ) throws -> T {
1919 return value
2020}
2121
22- @available ( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * )
22+ @available ( SwiftStdlib 5 . 5 , * )
2323func asynchronous< T> ( _ value: T ) async -> T {
2424 return value
2525}
2626
27- @available ( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * )
27+ @available ( SwiftStdlib 5 . 5 , * )
2828func asynchronousThrowing< T> ( _ value: T ) async throws -> T {
2929 return value
3030}
3131
32- @available ( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * )
32+ @available ( SwiftStdlib 5 . 5 , * )
3333struct Failure : Error , Equatable {
3434 var value = 1
3535}
3636
37- @available ( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * )
37+ @available ( SwiftStdlib 5 . 5 , * )
3838func failable< T, E: Error > (
3939 _ results: [ Result < T , E > ]
4040) -> AsyncThrowingMapSequence < AsyncLazySequence < [ Result < T , E > ] > , T > {
4141 return results. async . map { try $0. get ( ) }
4242}
4343
4444
45- @available ( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * )
45+ @available ( SwiftStdlib 5 . 5 , * )
4646extension Sequence {
4747 @inlinable
4848 public var async : AsyncLazySequence < Self > {
@@ -52,7 +52,7 @@ extension Sequence {
5252 }
5353}
5454
55- @available ( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * )
55+ @available ( SwiftStdlib 5 . 5 , * )
5656public struct AsyncLazySequence < S: Sequence > : AsyncSequence {
5757 public typealias Element = S . Element
5858 public typealias AsyncIterator = Iterator
@@ -85,7 +85,7 @@ public struct AsyncLazySequence<S: Sequence>: AsyncSequence {
8585 }
8686}
8787
88- @available ( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * )
88+ @available ( SwiftStdlib 5 . 5 , * )
8989extension AsyncSequence {
9090 @inlinable
9191 public func collect( ) async rethrows -> [ Element ] {
@@ -98,7 +98,7 @@ extension AsyncSequence {
9898 }
9999}
100100
101- @available( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * )
101+ @available( SwiftStdlib 5.5 , * )
102102extension AsyncSequence where Element: Equatable {
103103 func `throw`( _ error: Error , on element: Element ) -> AsyncThrowingMapSequence < Self , Element > {
104104 return map { ( value: Element ) throws -> Element in
@@ -110,7 +110,7 @@ extension AsyncSequence where Element: Equatable {
110110
111111@main struct Main {
112112 static func main( ) async {
113- if #available( macOS 9999 , iOS 9999 , watchOS 9999 , tvOS 9999 , * ) {
113+ if #available( SwiftStdlib 5 . 5 , * ) {
114114
115115 var AsyncLazySequenceTests = TestSuite ( " AsyncLazySequence " )
116116
0 commit comments