-
Following code does not compile with Xcode 13.4 which embeds Swift 5.6.1: struct Demo: ReducerProtocol {
struct State {
var value: String
}
enum Action {
case task
}
@ReducerBuilder<State, Action>
var body: some ReducerProtocol {
Reduce { state, action in
switch action {
case .task:
return .none
}
}
}
} It requires |
Beta Was this translation helpful? Give feedback.
Answered by
mbrandonw
Nov 14, 2022
Replies: 1 comment 2 replies
-
Hi @ylorn, since Swift 5.6.1 doesn't support primary associated types you must structure the struct Demo: ReducerProtocol {
struct State {
var value: String
}
enum Action {
case task
}
var body: Reduce<State, Action> {
Reduce { state, action in
switch action {
case .task:
return .none
}
}
}
} We have more information in our |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
ylorn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @ylorn, since Swift 5.6.1 doesn't support primary associated types you must structure the
body
like this:We have more information in our
ReducerProtocol
migration guide, in particular the section on Swift 5.6.