Skip to content

Commit 822ca93

Browse files
authored
Restore availability and mark everything as 9999 to match stdlib availability for 5.7 for now (#82)
1 parent ed1d2a0 commit 822ca93

15 files changed

+39
-8
lines changed

Package.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,12 @@ let package = Package(
2020
dependencies: [],
2121
targets: [
2222
.target(
23-
name: "AsyncAlgorithms",
24-
swiftSettings: [
25-
.unsafeFlags([
26-
"-Xfrontend", "-disable-availability-checking"
27-
])
28-
]),
23+
name: "AsyncAlgorithms"),
2924
.target(
3025
name: "AsyncSequenceValidation",
3126
dependencies: ["_CAsyncSequenceValidationSupport"],
3227
swiftSettings: [
3328
.unsafeFlags([
34-
"-Xfrontend", "-disable-availability-checking",
3529
"-Xfrontend", "-enable-experimental-pairwise-build-block"
3630
])
3731
]),

Sources/AsyncAlgorithms/AsyncChunksOfCountOrSignalSequence.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,22 @@ extension AsyncSequence {
2626
chunked(by: signal, into: [Element].self)
2727
}
2828

29+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
2930
public func chunks<C: Clock, Collected: RangeReplaceableCollection>(ofCount count: Int, or timer: AsyncTimerSequence<C>, into: Collected.Type) -> AsyncChunksOfCountOrSignalSequence<Self, Collected, AsyncTimerSequence<C>> where Collected.Element == Element {
3031
AsyncChunksOfCountOrSignalSequence(self, count: count, signal: timer)
3132
}
3233

34+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
3335
public func chunks<C: Clock>(ofCount count: Int, or timer: AsyncTimerSequence<C>) -> AsyncChunksOfCountOrSignalSequence<Self, [Element], AsyncTimerSequence<C>> {
3436
chunks(ofCount: count, or: timer, into: [Element].self)
3537
}
3638

39+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
3740
public func chunked<C: Clock, Collected: RangeReplaceableCollection>(by timer: AsyncTimerSequence<C>, into: Collected.Type) -> AsyncChunksOfCountOrSignalSequence<Self, Collected, AsyncTimerSequence<C>> where Collected.Element == Element {
3841
AsyncChunksOfCountOrSignalSequence(self, count: nil, signal: timer)
3942
}
4043

44+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
4145
public func chunked<C: Clock>(by timer: AsyncTimerSequence<C>) -> AsyncChunksOfCountOrSignalSequence<Self, [Element], AsyncTimerSequence<C>> {
4246
chunked(by: timer, into: [Element].self)
4347
}

Sources/AsyncAlgorithms/AsyncDebounceSequence.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,18 @@
1010
//===----------------------------------------------------------------------===//
1111

1212
extension AsyncSequence {
13+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
1314
public func debounce<C: Clock>(for interval: C.Instant.Duration, tolerance: C.Instant.Duration? = nil, clock: C) -> AsyncDebounceSequence<Self, C> {
1415
AsyncDebounceSequence(self, interval: interval, tolerance: tolerance, clock: clock)
1516
}
1617

18+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
1719
public func debounce(for interval: Duration, tolerance: Duration? = nil) -> AsyncDebounceSequence<Self, ContinuousClock> {
1820
debounce(for: interval, tolerance: tolerance, clock: .continuous)
1921
}
2022
}
2123

24+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
2225
public struct AsyncDebounceSequence<Base: AsyncSequence, C: Clock>: Sendable
2326
where Base.AsyncIterator: Sendable, Base.Element: Sendable, Base: Sendable {
2427
let base: Base
@@ -34,6 +37,7 @@ public struct AsyncDebounceSequence<Base: AsyncSequence, C: Clock>: Sendable
3437
}
3538
}
3639

40+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
3741
extension AsyncDebounceSequence: AsyncSequence {
3842
public typealias Element = Base.Element
3943

Sources/AsyncAlgorithms/AsyncThrottleSequence.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,17 @@
1010
//===----------------------------------------------------------------------===//
1111

1212
extension AsyncSequence {
13+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
1314
public func throttle<C: Clock, Reduced>(for interval: C.Instant.Duration, clock: C, reducing: @Sendable @escaping (Reduced?, Element) async -> Reduced) -> AsyncThrottleSequence<Self, C, Reduced> {
1415
AsyncThrottleSequence(self, interval: interval, clock: clock, reducing: reducing)
1516
}
1617

18+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
1719
public func throttle<Reduced>(for interval: Duration, reducing: @Sendable @escaping (Reduced?, Element) async -> Reduced) -> AsyncThrottleSequence<Self, ContinuousClock, Reduced> {
1820
throttle(for: interval, clock: .continuous, reducing: reducing)
1921
}
2022

23+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
2124
public func throttle<C: Clock>(for interval: C.Instant.Duration, clock: C, latest: Bool = true) -> AsyncThrottleSequence<Self, C, Element> {
2225
throttle(for: interval, clock: clock) { previous, element in
2326
if latest {
@@ -28,11 +31,13 @@ extension AsyncSequence {
2831
}
2932
}
3033

34+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
3135
public func throttle(for interval: Duration, latest: Bool = true) -> AsyncThrottleSequence<Self, ContinuousClock, Element> {
3236
throttle(for: interval, clock: .continuous, latest: latest)
3337
}
3438
}
3539

40+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
3641
public struct AsyncThrottleSequence<Base: AsyncSequence, C: Clock, Reduced> {
3742
let base: Base
3843
let interval: C.Instant.Duration
@@ -47,6 +52,7 @@ public struct AsyncThrottleSequence<Base: AsyncSequence, C: Clock, Reduced> {
4752
}
4853
}
4954

55+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
5056
extension AsyncThrottleSequence: AsyncSequence {
5157
public typealias Element = Reduced
5258

@@ -85,5 +91,8 @@ extension AsyncThrottleSequence: AsyncSequence {
8591
}
8692
}
8793

94+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
8895
extension AsyncThrottleSequence: Sendable where Base: Sendable, Element: Sendable { }
96+
97+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
8998
extension AsyncThrottleSequence.Iterator: Sendable where Base.AsyncIterator: Sendable { }

Sources/AsyncAlgorithms/AsyncTimerSequence.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
1213
public struct AsyncTimerSequence<C: Clock>: AsyncSequence {
1314
public typealias Element = C.Instant
1415

@@ -67,18 +68,22 @@ public struct AsyncTimerSequence<C: Clock>: AsyncSequence {
6768
}
6869
}
6970

71+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
7072
extension AsyncTimerSequence {
7173
public static func repeating(every interval: C.Instant.Duration, tolerance: C.Instant.Duration? = nil, clock: C) -> AsyncTimerSequence<C> {
7274
return AsyncTimerSequence(interval: interval, tolerance: tolerance, clock: clock)
7375
}
7476
}
7577

76-
78+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
7779
extension AsyncTimerSequence where C == SuspendingClock {
7880
public static func repeating(every interval: Duration, tolerance: Duration? = nil) -> AsyncTimerSequence<SuspendingClock> {
7981
return AsyncTimerSequence(interval: interval, tolerance: tolerance, clock: SuspendingClock())
8082
}
8183
}
8284

85+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
8386
extension AsyncTimerSequence: Sendable { }
87+
88+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
8489
extension AsyncTimerSequence.Iterator: Sendable { }

Sources/AsyncSequenceValidation/AsyncSequenceValidationDiagram.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
import _CAsyncSequenceValidationSupport
1313

14+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
1415
@resultBuilder
1516
public struct AsyncSequenceValidationDiagram : Sendable {
1617
public struct Component<T> {

Sources/AsyncSequenceValidation/Clock.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
1213
extension AsyncSequenceValidationDiagram {
1314
public struct Clock {
1415
let queue: WorkQueue
@@ -19,6 +20,7 @@ extension AsyncSequenceValidationDiagram {
1920
}
2021
}
2122

23+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
2224
extension AsyncSequenceValidationDiagram.Clock: Clock {
2325
public struct Step: DurationProtocol, Hashable, CustomStringConvertible {
2426
internal var rawValue: Int

Sources/AsyncSequenceValidation/Event.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
1213
extension AsyncSequenceValidationDiagram {
1314
struct Failure: Error, Equatable { }
1415

Sources/AsyncSequenceValidation/Expectation.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
1213
extension AsyncSequenceValidationDiagram {
1314
public struct ExpectationResult: Sendable {
1415
public struct Event: Sendable {

Sources/AsyncSequenceValidation/Input.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
//
1010
//===----------------------------------------------------------------------===//
1111

12+
@available(macOS 9999, iOS 9999, tvOS 9999, watchOS 9999, *)
1213
extension AsyncSequenceValidationDiagram {
1314
public struct Specification: Sendable {
1415
public let specification: String

0 commit comments

Comments
 (0)