Skip to content

Commit f1af337

Browse files
authored
Swift 6 updates (pointfreeco#3379)
* Swift 6 updates - Soft-deprecate `_SynthesizedConformance` now that Xcode 16 has fixed this bug. - Update docs accordingly. - Document Xcode 16 macro gotcha around custom build configuration names. * wip
1 parent 8013f1a commit f1af337

File tree

35 files changed

+112
-101
lines changed

35 files changed

+112
-101
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,11 @@ jobs:
8282
deriveddata-examples-${{ hashFiles('**/Sources/**/*.swift', '**/Tests/**/*.swift', '**/Examples/**/*.swift') }}
8383
restore-keys: |
8484
deriveddata-examples-
85-
- name: Select Xcode 15.4
86-
run: sudo xcode-select -s /Applications/Xcode_15.4.app
87-
- name: Set IgnoreFileSystemDeviceInodeChanges flag
85+
- name: Select Xcode 16
86+
run: sudo xcode-select -s /Applications/Xcode_16_beta_6.app
87+
- name: Set IgnoreFileSystemDeviceInodeChanges flag
8888
run: defaults write com.apple.dt.XCBuild IgnoreFileSystemDeviceInodeChanges -bool YES
89-
- name: Update mtime for incremental builds
89+
- name: Update mtime for incremental builds
9090
uses: chetan/git-restore-mtime-action@v2
9191
- name: CaseStudies (SwiftUI)
9292
run: make SCHEME="CaseStudies (SwiftUI)" test-example

Examples/CaseStudies/SwiftUICaseStudies/04-Navigation-Multiple-Destinations.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ private let readMe = """
88

99
@Reducer
1010
struct MultipleDestinations {
11-
@Reducer(state: .equatable)
11+
@Reducer
1212
enum Destination {
1313
case drillDown(Counter)
1414
case popover(Counter)
@@ -46,6 +46,7 @@ struct MultipleDestinations {
4646
.ifLet(\.$destination, action: \.destination)
4747
}
4848
}
49+
extension MultipleDestinations.Destination.State: Equatable {}
4950

5051
struct MultipleDestinationsView: View {
5152
@Bindable var store: StoreOf<MultipleDestinations>

Examples/CaseStudies/SwiftUICaseStudies/04-NavigationStack.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ private let readMe = """
77

88
@Reducer
99
struct NavigationDemo {
10-
@Reducer(state: .equatable)
10+
@Reducer
1111
enum Path {
1212
case screenA(ScreenA)
1313
case screenB(ScreenB)
@@ -65,6 +65,7 @@ struct NavigationDemo {
6565
.forEach(\.path, action: \.path)
6666
}
6767
}
68+
extension NavigationDemo.Path.State: Equatable {}
6869

6970
struct NavigationDemoView: View {
7071
@Bindable var store: StoreOf<NavigationDemo>

Examples/Integration/Integration/Legacy/LegacyPresentationTestCase.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ private enum PresentationTestCase {
99
var message = ""
1010
@PresentationState var destination: Destination.State?
1111
}
12-
enum Action: Equatable, Sendable {
12+
enum Action: Sendable {
1313
case alertButtonTapped
1414
case customAlertButtonTapped
1515
case destination(PresentationAction<Destination.Action>)
@@ -21,7 +21,7 @@ private enum PresentationTestCase {
2121
case sheetButtonTapped
2222
}
2323

24-
@Reducer(state: .equatable, action: .equatable)
24+
@Reducer
2525
enum Destination {
2626
case alert(AlertState<AlertAction>)
2727
case customAlert
@@ -312,8 +312,8 @@ private enum PresentationTestCase {
312312
}
313313
}
314314
}
315-
316315
}
316+
extension PresentationTestCase.Feature.Destination.State: Equatable {}
317317

318318
struct PresentationTestCaseView: View {
319319
private let store: StoreOf<PresentationTestCase.Feature>

Examples/Integration/Integration/iOS 17/ObservableEnumTestCase.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ struct ObservableEnumView: View {
6666

6767
@Reducer
6868
struct Feature {
69-
@Reducer(state: .equatable)
69+
@Reducer
7070
enum Destination {
7171
case feature1(ObservableBasicsView.Feature)
7272
case feature2(ObservableBasicsView.Feature)
@@ -111,6 +111,7 @@ struct ObservableEnumView: View {
111111
}
112112
}
113113
}
114+
extension ObservableEnumView.Feature.Destination.State: Equatable {}
114115

115116
#Preview {
116117
Logger.shared.isEnabled = true

Examples/Integration/Integration/iOS 17/ObservablePresentationTestCase.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ struct ObservablePresentationView: View {
9494

9595
@Reducer
9696
struct Feature {
97-
@Reducer(state: .equatable)
97+
@Reducer
9898
enum Destination {
9999
case fullScreenCover(ObservableBasicsView.Feature)
100100
case popover(ObservableBasicsView.Feature)
@@ -146,3 +146,4 @@ struct ObservablePresentationView: View {
146146
}
147147
}
148148
}
149+
extension ObservablePresentationView.Feature.Destination.State: Equatable {}

Examples/SyncUps/SyncUps/AppFeature.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import SwiftUI
33

44
@Reducer
55
struct AppFeature {
6-
@Reducer(state: .equatable)
6+
@Reducer
77
enum Path {
88
case detail(SyncUpDetail)
99
case meeting(Meeting, syncUp: SyncUp)
@@ -47,6 +47,7 @@ struct AppFeature {
4747
.forEach(\.path, action: \.path)
4848
}
4949
}
50+
extension AppFeature.Path.State: Equatable {}
5051

5152
struct AppView: View {
5253
@Bindable var store: StoreOf<AppFeature>

Examples/SyncUps/SyncUps/SyncUpDetail.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import SwiftUI
33

44
@Reducer
55
struct SyncUpDetail {
6-
@Reducer(state: .equatable)
6+
@Reducer
77
enum Destination {
88
case alert(AlertState<Alert>)
99
case edit(SyncUpForm)
@@ -109,6 +109,7 @@ struct SyncUpDetail {
109109
.ifLet(\.$destination, action: \.destination)
110110
}
111111
}
112+
extension SyncUpDetail.Destination.State: Equatable {}
112113

113114
struct SyncUpDetailView: View {
114115
@Bindable var store: StoreOf<SyncUpDetail>

Examples/SyncUps/SyncUps/SyncUpsList.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import SwiftUI
33

44
@Reducer
55
struct SyncUpsList {
6-
@Reducer(state: .equatable)
6+
@Reducer
77
enum Destination {
88
case add(SyncUpForm)
99
case alert(AlertState<Alert>)
@@ -73,6 +73,7 @@ struct SyncUpsList {
7373
.ifLet(\.$destination, action: \.destination)
7474
}
7575
}
76+
extension SyncUpsList.Destination.State: Equatable {}
7677

7778
struct SyncUpsListView: View {
7879
@Bindable var store: StoreOf<SyncUpsList>

Examples/TicTacToe/tic-tac-toe/Sources/AppCore/AppCore.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import ComposableArchitecture
22
import LoginCore
33
import NewGameCore
44

5-
@Reducer(state: .equatable)
5+
@Reducer
66
public enum TicTacToe {
77
case login(Login)
88
case newGame(NewGame)
@@ -37,3 +37,4 @@ public enum TicTacToe {
3737
}
3838
}
3939
}
40+
extension TicTacToe.State: Equatable {}

0 commit comments

Comments
 (0)