Skip to content

Commit

Permalink
Added missing namespace for Scope when in ReducerMacro (#2832)
Browse files Browse the repository at this point in the history
* Added missing namespace to Scope when generating Reducer with macro

* Update ReducerMacroTests.swift
  • Loading branch information
stefancodinglands committed Feb 19, 2024
1 parent da1cd10 commit 09aab16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Sources/ComposableArchitectureMacros/ReducerMacro.swift
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ extension ReducerMacro: MemberMacro {
)
reducerTypeScopes.append(
"""
Scope<Self.State, Self.Action, \(type.trimmed)>
ComposableArchitecture.Scope<Self.State, Self.Action, \(type.trimmed)>
"""
)
}
Expand Down
10 changes: 5 additions & 5 deletions Tests/ComposableArchitectureMacrosTests/ReducerMacroTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
}
@ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>
static var body: ReducerBuilder<Self.State, Self.Action>._Sequence<ReducerBuilder<Self.State, Self.Action>._Sequence<Scope<Self.State, Self.Action, Activity>, Scope<Self.State, Self.Action, Timeline>>, Scope<Self.State, Self.Action, Tweet>> {
static var body: ReducerBuilder<Self.State, Self.Action>._Sequence<ReducerBuilder<Self.State, Self.Action>._Sequence<ComposableArchitecture.Scope<Self.State, Self.Action, Activity>, ComposableArchitecture.Scope<Self.State, Self.Action, Timeline>>, ComposableArchitecture.Scope<Self.State, Self.Action, Tweet>> {
ComposableArchitecture.Scope(state: \Self.State.Cases.activity, action: \Self.Action.Cases.activity) {
Activity()
}
Expand Down Expand Up @@ -372,7 +372,7 @@
}
@ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>
static var body: ReducerBuilder<Self.State, Self.Action>._Sequence<Scope<Self.State, Self.Action, Activity>, Scope<Self.State, Self.Action, Timeline>> {
static var body: ReducerBuilder<Self.State, Self.Action>._Sequence<ComposableArchitecture.Scope<Self.State, Self.Action, Activity>, ComposableArchitecture.Scope<Self.State, Self.Action, Timeline>> {
ComposableArchitecture.Scope(state: \Self.State.Cases.activity, action: \Self.Action.Cases.activity) {
Activity()
}
Expand Down Expand Up @@ -434,7 +434,7 @@
}
@ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>
static var body: Scope<Self.State, Self.Action, Timeline> {
static var body: ComposableArchitecture.Scope<Self.State, Self.Action, Timeline> {
ComposableArchitecture.Scope(state: \Self.State.Cases.timeline, action: \Self.Action.Cases.timeline) {
Timeline()
}
Expand Down Expand Up @@ -561,7 +561,7 @@
}
@ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>
static var body: ReducerBuilder<Self.State, Self.Action>._Sequence<ReducerBuilder<Self.State, Self.Action>._Sequence<Scope<Self.State, Self.Action, Counter>, Scope<Self.State, Self.Action, Counter>>, Scope<Self.State, Self.Action, Counter>> {
static var body: ReducerBuilder<Self.State, Self.Action>._Sequence<ReducerBuilder<Self.State, Self.Action>._Sequence<ComposableArchitecture.Scope<Self.State, Self.Action, Counter>, ComposableArchitecture.Scope<Self.State, Self.Action, Counter>>, ComposableArchitecture.Scope<Self.State, Self.Action, Counter>> {
ComposableArchitecture.Scope(state: \Self.State.Cases.drillDown, action: \Self.Action.Cases.drillDown) {
Counter()
}
Expand Down Expand Up @@ -624,7 +624,7 @@
}
@ComposableArchitecture.ReducerBuilder<Self.State, Self.Action>
static var body: Scope<Self.State, Self.Action, Nested.Feature> {
static var body: ComposableArchitecture.Scope<Self.State, Self.Action, Nested.Feature> {
ComposableArchitecture.Scope(state: \Self.State.Cases.feature, action: \Self.Action.Cases.feature) {
Nested.Feature()
}
Expand Down

0 comments on commit 09aab16

Please sign in to comment.