From 3d18d129db9d7ed35cd8e26f1b91ede1d20c34d9 Mon Sep 17 00:00:00 2001 From: Stephen Celis Date: Tue, 15 Oct 2024 09:52:44 -0700 Subject: [PATCH] Fix Swift <6 warning Bit casting a type to the type it already is produces a warning. --- .../ComposableArchitecture/Internal/KeyPath+Sendable.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 }