diff --git a/Sources/ComposableArchitecture/Internal/KeyPath+Sendable.swift b/Sources/ComposableArchitecture/Internal/KeyPath+Sendable.swift index 57bc9876dc4a..fae979cff8d1 100644 --- a/Sources/ComposableArchitecture/Internal/KeyPath+Sendable.swift +++ b/Sources/ComposableArchitecture/Internal/KeyPath+Sendable.swift @@ -26,5 +26,9 @@ func sendableKeyPath( _ keyPath: AnyKeyPath ) -> _SendableAnyKeyPath { - unsafeBitCast(keyPath, to: _SendableAnyKeyPath.self) + #if compiler(>=6) + unsafeBitCast(keyPath, to: _SendableAnyKeyPath.self) + #else + keyPath + #endif }