File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -87,9 +87,11 @@ public final class FlagPole<RootGroup>: Sendable where RootGroup: FlagContainer
8787 ///
8888 public static var defaultSources : [ any FlagValueSource ] {
8989#if !os(Linux)
90- [
91- FlagValueSourceCoordinator ( source: UserDefaults . standard) ,
92- ]
90+ #if swift(>=6)
91+ [ FlagValueSourceCoordinator ( source: UserDefaults . standard) ]
92+ #else
93+ [ FlagValueSourceCoordinator ( uncheckedSource: UserDefaults . standard) ]
94+ #endif
9395#else
9496 [ ]
9597#endif
Original file line number Diff line number Diff line change @@ -27,10 +27,20 @@ public final class FlagValueSourceCoordinator<Source>: Sendable where Source: No
2727
2828 // MARK: - Initialisation
2929
30- public init ( source: Source ) {
30+ /// Create a FlagValueSource from a NonSendableFlagValueSource. If `Source` is a reference type,
31+ /// you must not continue to access it (except via this coordinator) after passing it to this
32+ /// initializer.
33+ public init ( uncheckedSource source: Source ) {
3134 self . source = . init( uncheckedState: source)
3235 }
3336
37+ #if swift(>=6)
38+ /// Create a FlagValueSource from a NonSendableFlagValueSource.
39+ public init ( source: sending Source) {
40+ self . source = . init( uncheckedState: source)
41+ }
42+ #endif
43+
3444}
3545
3646
You can’t perform that action at this time.
0 commit comments