diff --git a/Sources/Atoms/Modifier/ChangesOfModifier.swift b/Sources/Atoms/Modifier/ChangesOfModifier.swift index 0bb7c526..2021ec1a 100644 --- a/Sources/Atoms/Modifier/ChangesOfModifier.swift +++ b/Sources/Atoms/Modifier/ChangesOfModifier.swift @@ -22,7 +22,7 @@ public extension Atom { /// - Parameter keyPath: A key path for the property of the original atom value. /// /// - Returns: An atom that provides the partial property of the original atom value. - #if hasFeature(InferSendableFromCaptures) + #if compiler(>=6) || hasFeature(InferSendableFromCaptures) func changes( of keyPath: KeyPath & Sendable ) -> ModifiedAtom> { @@ -57,7 +57,7 @@ public struct ChangesOfModifier: AtomModifier { } } - #if hasFeature(InferSendableFromCaptures) + #if compiler(>=6) || hasFeature(InferSendableFromCaptures) private let keyPath: KeyPath & Sendable internal init(keyPath: KeyPath & Sendable) { diff --git a/Sources/Atoms/PropertyWrapper/ViewContext.swift b/Sources/Atoms/PropertyWrapper/ViewContext.swift index 2008dbc8..fd413d81 100644 --- a/Sources/Atoms/PropertyWrapper/ViewContext.swift +++ b/Sources/Atoms/PropertyWrapper/ViewContext.swift @@ -52,7 +52,7 @@ public struct ViewContext: DynamicProperty { /// This property provides primary access to the view context. However you don't /// access ``wrappedValue`` directly. /// Instead, you use the property variable created with the `@ViewContext` attribute. - #if hasFeature(DisableOutwardActorInference) + #if compiler(>=6) || hasFeature(DisableOutwardActorInference) @MainActor #endif public var wrappedValue: AtomViewContext { diff --git a/Sources/Atoms/PropertyWrapper/Watch.swift b/Sources/Atoms/PropertyWrapper/Watch.swift index b9bd2a06..3e57d344 100644 --- a/Sources/Atoms/PropertyWrapper/Watch.swift +++ b/Sources/Atoms/PropertyWrapper/Watch.swift @@ -40,7 +40,7 @@ public struct Watch: DynamicProperty { /// access ``wrappedValue`` directly. Instead, you use the property variable created /// with the `@Watch` attribute. /// Accessing this property starts watching the atom. - #if hasFeature(DisableOutwardActorInference) + #if compiler(>=6) || hasFeature(DisableOutwardActorInference) @MainActor #endif public var wrappedValue: Node.Produced { diff --git a/Sources/Atoms/PropertyWrapper/WatchState.swift b/Sources/Atoms/PropertyWrapper/WatchState.swift index b75a3670..221716ba 100644 --- a/Sources/Atoms/PropertyWrapper/WatchState.swift +++ b/Sources/Atoms/PropertyWrapper/WatchState.swift @@ -50,7 +50,7 @@ public struct WatchState: DynamicProperty { /// with the `@WatchState` attribute. /// Accessing to the getter of this property starts watching the atom, but doesn't /// by setting a new value. - #if hasFeature(DisableOutwardActorInference) + #if compiler(>=6) || hasFeature(DisableOutwardActorInference) @MainActor #endif public var wrappedValue: Node.Produced { @@ -64,7 +64,7 @@ public struct WatchState: DynamicProperty { /// To get the ``projectedValue``, prefix the property variable with `$`. /// Accessing this property itself does not start watching the atom, but does when /// the view accesses to the getter of the binding. - #if hasFeature(DisableOutwardActorInference) + #if compiler(>=6) || hasFeature(DisableOutwardActorInference) @MainActor #endif public var projectedValue: Binding { diff --git a/Sources/Atoms/PropertyWrapper/WatchStateObject.swift b/Sources/Atoms/PropertyWrapper/WatchStateObject.swift index e9c498b2..65919542 100644 --- a/Sources/Atoms/PropertyWrapper/WatchStateObject.swift +++ b/Sources/Atoms/PropertyWrapper/WatchStateObject.swift @@ -84,7 +84,7 @@ public struct WatchStateObject: DynamicProperty { /// access ``wrappedValue`` directly. Instead, you use the property variable created /// with the `@WatchStateObject` attribute. /// Accessing this property starts watching the atom. - #if hasFeature(DisableOutwardActorInference) + #if compiler(>=6) || hasFeature(DisableOutwardActorInference) @MainActor #endif public var wrappedValue: Node.Produced { @@ -95,7 +95,7 @@ public struct WatchStateObject: DynamicProperty { /// /// Use the projected value to pass a binding value down a view hierarchy. /// To get the projected value, prefix the property variable with `$`. - #if hasFeature(DisableOutwardActorInference) + #if compiler(>=6) || hasFeature(DisableOutwardActorInference) @MainActor #endif public var projectedValue: Wrapper {