Skip to content

Commit

Permalink
Update KeyPath+Sendable.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
stephencelis authored Oct 23, 2024
1 parent a225201 commit 24de5a3
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions Sources/CasePaths/Internal/KeyPath+Sendable.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
#if compiler(>=6)
public typealias _SendableKeyPath<Root, Value> = any KeyPath<Root, Value> & Sendable
public typealias _SendableWritableKeyPath<Root, Value> = any WritableKeyPath<Root, Value>
& Sendable
#else
public typealias _SendableKeyPath<Root, Value> = KeyPath<Root, Value>
public typealias _SendableWritableKeyPath<Root, Value> = WritableKeyPath<Root, Value>
#endif

// NB: Dynamic member lookup does not currently support sendable key paths and even breaks
Expand All @@ -22,14 +19,4 @@ extension _AppendKeyPath {
self
#endif
}

@_transparent
package func unsafeSendable<Root, Value>() -> _SendableWritableKeyPath<Root, Value>
where Self == WritableKeyPath<Root, Value> {
#if compiler(>=6)
unsafeBitCast(self, to: _SendableWritableKeyPath<Root, Value>.self)
#else
self
#endif
}
}

0 comments on commit 24de5a3

Please sign in to comment.