Skip to content

Commit f081ed4

Browse files
authored
Add @warn_unqualified_access to reducer operators. (pointfreeco#1950)
1 parent a275d7d commit f081ed4

File tree

7 files changed

+8
-0
lines changed

7 files changed

+8
-0
lines changed

Sources/ComposableArchitecture/Internal/Deprecations.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ extension ViewStore {
8888

8989
extension ReducerProtocol {
9090
@available(*, deprecated, renamed: "_printChanges")
91+
@warn_unqualified_access
9192
public func debug() -> _PrintChangesReducer<Self> {
9293
self._printChanges()
9394
}

Sources/ComposableArchitecture/Reducer/Reducers/DebugReducer.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ extension ReducerProtocol {
77
/// - Parameter printer: A printer for printing debug messages.
88
/// - Returns: A reducer that prints debug messages for all received actions.
99
@inlinable
10+
@warn_unqualified_access
1011
public func _printChanges(
1112
_ printer: _ReducerPrinter<State, Action>? = .customDump
1213
) -> _PrintChangesReducer<Self> {

Sources/ComposableArchitecture/Reducer/Reducers/DependencyKeyWritingReducer.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ extension ReducerProtocol {
6666
/// - value: The new value to set for the item specified by `keyPath`.
6767
/// - Returns: A reducer that has the given value set in its dependencies.
6868
@inlinable
69+
@warn_unqualified_access
6970
public func dependency<Value>(
7071
_ keyPath: WritableKeyPath<DependencyValues, Value>,
7172
_ value: Value
@@ -117,6 +118,7 @@ extension ReducerProtocol {
117118
/// - transform: A closure that is handed a mutable instance of the value specified by the key
118119
/// path.
119120
@inlinable
121+
@warn_unqualified_access
120122
public func transformDependency<V>(
121123
_ keyPath: WritableKeyPath<DependencyValues, V>,
122124
transform: @escaping (inout V) -> Void

Sources/ComposableArchitecture/Reducer/Reducers/ForEachReducer.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ extension ReducerProtocol {
5050
/// state.
5151
/// - Returns: A reducer that combines the child reducer with the parent reducer.
5252
@inlinable
53+
@warn_unqualified_access
5354
public func forEach<ElementState, ElementAction, ID: Hashable, Element: ReducerProtocol>(
5455
_ toElementsState: WritableKeyPath<State, IdentifiedArray<ID, ElementState>>,
5556
action toElementAction: CasePath<Action, (ID, ElementAction)>,

Sources/ComposableArchitecture/Reducer/Reducers/IfCaseLetReducer.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ extension ReducerProtocol {
4646
/// present
4747
/// - Returns: A reducer that combines the child reducer with the parent reducer.
4848
@inlinable
49+
@warn_unqualified_access
4950
public func ifCaseLet<CaseState, CaseAction, Case: ReducerProtocol>(
5051
_ toCaseState: CasePath<State, CaseState>,
5152
action toCaseAction: CasePath<Action, CaseAction>,

Sources/ComposableArchitecture/Reducer/Reducers/IfLetReducer.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ extension ReducerProtocol {
4343
/// state.
4444
/// - Returns: A reducer that combines the child reducer with the parent reducer.
4545
@inlinable
46+
@warn_unqualified_access
4647
public func ifLet<WrappedState, WrappedAction, Wrapped: ReducerProtocol>(
4748
_ toWrappedState: WritableKeyPath<State, WrappedState?>,
4849
action toWrappedAction: CasePath<Action, WrappedAction>,

Sources/ComposableArchitecture/Reducer/Reducers/SignpostReducer.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ extension ReducerProtocol {
2121
/// - log: An `OSLog` to use for signposts.
2222
/// - Returns: A reducer that has been enhanced with instrumentation.
2323
@inlinable
24+
@warn_unqualified_access
2425
public func signpost(
2526
_ prefix: String = "",
2627
log: OSLog = OSLog(

0 commit comments

Comments
 (0)