Skip to content

Commit

Permalink
[FIX] Modified Swift compiler version to 5.7.1 to follow Apple's poli…
Browse files Browse the repository at this point in the history
  • Loading branch information
x-0o0 authored Nov 7, 2023
1 parent 6eb8faa commit 17c0cba
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 27 deletions.
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.7
// swift-tools-version:5.7.1

import PackageDescription

Expand Down
6 changes: 2 additions & 4 deletions Sources/ComposableArchitecture/Internal/Deprecations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,5 @@ public typealias EffectTask = Effect
@available(*, unavailable, renamed: "Reducer")
public typealias ReducerProtocol = Reducer

#if swift(>=5.7.1)
@available(*, unavailable, renamed: "ReducerOf")
public typealias ReducerProtocolOf<R: Reducer> = Reducer<R.State, R.Action>
#endif
@available(*, unavailable, renamed: "ReducerOf")
public typealias ReducerProtocolOf<R: Reducer> = Reducer<R.State, R.Action>
40 changes: 18 additions & 22 deletions Sources/ComposableArchitecture/Reducer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -247,25 +247,21 @@ extension Reducer where Body: Reducer, Body.State == State, Body.Action == Actio
}
}

// NB: This is available starting from Swift 5.7.1 due to the following bug:
// https://github.com/apple/swift/issues/60550
#if swift(>=5.7.1)
/// A convenience for constraining a ``Reducer`` conformance.
///
/// This allows you to specify the `body` of a ``Reducer`` conformance like so:
///
/// ```swift
/// var body: some ReducerOf<Self> {
/// // ...
/// }
/// ```
///
/// …instead of the more verbose:
///
/// ```swift
/// var body: some Reducer<State, Action> {
/// // ...
/// }
/// ```
public typealias ReducerOf<R: Reducer> = Reducer<R.State, R.Action>
#endif
/// A convenience for constraining a ``Reducer`` conformance.
///
/// This allows you to specify the `body` of a ``Reducer`` conformance like so:
///
/// ```swift
/// var body: some ReducerOf<Self> {
/// // ...
/// }
/// ```
///
/// …instead of the more verbose:
///
/// ```swift
/// var body: some Reducer<State, Action> {
/// // ...
/// }
/// ```
public typealias ReducerOf<R: Reducer> = Reducer<R.State, R.Action>

0 comments on commit 17c0cba

Please sign in to comment.