@@ -67,7 +67,7 @@ public protocol MultipleInputIndexRepresentation<
6767 Value
6868> : RetrievableIndexRepresentation {
6969 /// The sequence of values represented in the index.
70- associatedtype Sequence : Swift . Sequence < Value >
70+ associatedtype Sequence : Swift . Sequence < Value > & Sendable
7171}
7272
7373/// An index where every value matches at most a single instance.
@@ -76,7 +76,7 @@ public protocol MultipleInputIndexRepresentation<
7676public struct OneToOneIndexRepresentation <
7777 Instance: Sendable ,
7878 Value: Indexable & DiscreteIndexable
79- > : SingleInstanceIndexRepresentation , @ unchecked Sendable {
79+ > : SingleInstanceIndexRepresentation {
8080 @usableFromInline
8181 let keypath : KeyPath < Instance , Value >
8282
@@ -109,7 +109,7 @@ public struct OneToOneIndexRepresentation<
109109public struct OneToManyIndexRepresentation <
110110 Instance: Sendable ,
111111 Value: Indexable
112- > : RetrievableIndexRepresentation , @ unchecked Sendable {
112+ > : RetrievableIndexRepresentation {
113113 @usableFromInline
114114 let keypath : KeyPath < Instance , Value >
115115
@@ -142,9 +142,9 @@ public struct OneToManyIndexRepresentation<
142142/// This type of index can be used if several alternative identifiers can reference an instance, and they all reside in a single property.
143143public struct ManyToOneIndexRepresentation <
144144 Instance: Sendable ,
145- Sequence: Swift . Sequence < Value > ,
145+ Sequence: Swift . Sequence < Value > & Sendable ,
146146 Value: Indexable & DiscreteIndexable
147- > : SingleInstanceIndexRepresentation & MultipleInputIndexRepresentation , @ unchecked Sendable {
147+ > : SingleInstanceIndexRepresentation & MultipleInputIndexRepresentation {
148148 @usableFromInline
149149 let keypath : KeyPath < Instance , Sequence >
150150
@@ -177,9 +177,9 @@ public struct ManyToOneIndexRepresentation<
177177/// This type of index is common when building relationships between different instances, where one instance may be related to several others in some way.
178178public struct ManyToManyIndexRepresentation <
179179 Instance: Sendable ,
180- Sequence: Swift . Sequence < Value > ,
180+ Sequence: Swift . Sequence < Value > & Sendable ,
181181 Value: Indexable
182- > : MultipleInputIndexRepresentation , @ unchecked Sendable {
182+ > : MultipleInputIndexRepresentation {
183183 @usableFromInline
184184 let keypath : KeyPath < Instance , Sequence >
185185
@@ -274,3 +274,6 @@ public struct AnyIndexRepresentation<Instance: Sendable>: Hashable, Sendable {
274274 hasher. combine ( indexRepresentation)
275275 }
276276}
277+
278+ /// Forced KeyPath conformance since Swift 5.10 doesn't support it out of the box.
279+ extension KeyPath : @unchecked Sendable where Root: Sendable , Value: Sendable { }
0 commit comments