diff --git a/Sources/ConcurrencyHelpers/Lock.swift b/Sources/ConcurrencyHelpers/Lock.swift index c3e3686..272a749 100644 --- a/Sources/ConcurrencyHelpers/Lock.swift +++ b/Sources/ConcurrencyHelpers/Lock.swift @@ -136,7 +136,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)