Skip to content

Commit 81a4d06

Browse files
authored
Add compiler(>=6) to complation conditions along with upcoming features (#150)
1 parent 8d280cf commit 81a4d06

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

Sources/Atoms/Modifier/ChangesOfModifier.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public extension Atom {
2222
/// - Parameter keyPath: A key path for the property of the original atom value.
2323
///
2424
/// - Returns: An atom that provides the partial property of the original atom value.
25-
#if hasFeature(InferSendableFromCaptures)
25+
#if compiler(>=6) || hasFeature(InferSendableFromCaptures)
2626
func changes<T: Equatable>(
2727
of keyPath: KeyPath<Produced, T> & Sendable
2828
) -> ModifiedAtom<Self, ChangesOfModifier<Produced, T>> {
@@ -57,7 +57,7 @@ public struct ChangesOfModifier<Base, Produced: Equatable>: AtomModifier {
5757
}
5858
}
5959

60-
#if hasFeature(InferSendableFromCaptures)
60+
#if compiler(>=6) || hasFeature(InferSendableFromCaptures)
6161
private let keyPath: KeyPath<Base, Produced> & Sendable
6262

6363
internal init(keyPath: KeyPath<Base, Produced> & Sendable) {

Sources/Atoms/PropertyWrapper/ViewContext.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public struct ViewContext: DynamicProperty {
5252
/// This property provides primary access to the view context. However you don't
5353
/// access ``wrappedValue`` directly.
5454
/// Instead, you use the property variable created with the `@ViewContext` attribute.
55-
#if hasFeature(DisableOutwardActorInference)
55+
#if compiler(>=6) || hasFeature(DisableOutwardActorInference)
5656
@MainActor
5757
#endif
5858
public var wrappedValue: AtomViewContext {

Sources/Atoms/PropertyWrapper/Watch.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public struct Watch<Node: Atom>: DynamicProperty {
4040
/// access ``wrappedValue`` directly. Instead, you use the property variable created
4141
/// with the `@Watch` attribute.
4242
/// Accessing this property starts watching the atom.
43-
#if hasFeature(DisableOutwardActorInference)
43+
#if compiler(>=6) || hasFeature(DisableOutwardActorInference)
4444
@MainActor
4545
#endif
4646
public var wrappedValue: Node.Produced {

Sources/Atoms/PropertyWrapper/WatchState.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public struct WatchState<Node: StateAtom>: DynamicProperty {
5050
/// with the `@WatchState` attribute.
5151
/// Accessing to the getter of this property starts watching the atom, but doesn't
5252
/// by setting a new value.
53-
#if hasFeature(DisableOutwardActorInference)
53+
#if compiler(>=6) || hasFeature(DisableOutwardActorInference)
5454
@MainActor
5555
#endif
5656
public var wrappedValue: Node.Produced {
@@ -64,7 +64,7 @@ public struct WatchState<Node: StateAtom>: DynamicProperty {
6464
/// To get the ``projectedValue``, prefix the property variable with `$`.
6565
/// Accessing this property itself does not start watching the atom, but does when
6666
/// the view accesses to the getter of the binding.
67-
#if hasFeature(DisableOutwardActorInference)
67+
#if compiler(>=6) || hasFeature(DisableOutwardActorInference)
6868
@MainActor
6969
#endif
7070
public var projectedValue: Binding<Node.Produced> {

Sources/Atoms/PropertyWrapper/WatchStateObject.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public struct WatchStateObject<Node: ObservableObjectAtom>: DynamicProperty {
8484
/// access ``wrappedValue`` directly. Instead, you use the property variable created
8585
/// with the `@WatchStateObject` attribute.
8686
/// Accessing this property starts watching the atom.
87-
#if hasFeature(DisableOutwardActorInference)
87+
#if compiler(>=6) || hasFeature(DisableOutwardActorInference)
8888
@MainActor
8989
#endif
9090
public var wrappedValue: Node.Produced {
@@ -95,7 +95,7 @@ public struct WatchStateObject<Node: ObservableObjectAtom>: DynamicProperty {
9595
///
9696
/// Use the projected value to pass a binding value down a view hierarchy.
9797
/// To get the projected value, prefix the property variable with `$`.
98-
#if hasFeature(DisableOutwardActorInference)
98+
#if compiler(>=6) || hasFeature(DisableOutwardActorInference)
9999
@MainActor
100100
#endif
101101
public var projectedValue: Wrapper {

0 commit comments

Comments
 (0)