diff --git a/Sources/OpenAPIURLSession/BufferedStream/Lock.swift b/Sources/OpenAPIURLSession/BufferedStream/Lock.swift index db78c8b..b6e82e2 100644 --- a/Sources/OpenAPIURLSession/BufferedStream/Lock.swift +++ b/Sources/OpenAPIURLSession/BufferedStream/Lock.swift @@ -111,7 +111,8 @@ final class LockStorage: ManagedBuffer { let buffer = Self.create(minimumCapacity: 1) { _ in return value } - let storage = unsafeDowncast(buffer, to: Self.self) + // Avoid 'unsafeDowncast' as there is a miscompilation on 5.10. + let storage = buffer as! Self storage.withUnsafeMutablePointers { _, lockPtr in LockOperations.create(lockPtr)