Fix some compiler warnings with -Xfrontend -warn-concurrency

https://twitter.com/olebegemann/status/1467893554915782668
This commit is contained in:
Gwendal Roué committed 2021-12-07 09:23:37 +01:00
1 parent 6ec3ebc398
commit 8ed16f4440
6 files changed
+23 -2

No files matched your search

+4
View File
@@ -189,6 +189,10 @@ extension ResultCode {
}
}
#if compiler(>=5.5.1)
extension ResultCode: Sendable { }
#endif
/// DatabaseError wraps an SQLite error.
public struct DatabaseError: Error, CustomStringConvertible, CustomNSError {
+7
View File
@@ -157,6 +157,13 @@ extension DatabaseValue: StatementBinding {
}
}
#if compiler(>=5.5.1)
// @unchecked due to Foundation.Data not conforming to Sendable
// TODO: Remove @unchecked when Foundation has been upgraded
extension DatabaseValue.Storage: @unchecked Sendable { }
extension DatabaseValue: Sendable { }
#endif
// MARK: - Hashable & Equatable
// Hashable
+6
View File
@@ -23,6 +23,7 @@ enum RowDecodingError: Error {
@usableFromInline
let debugDescription: String
// TODO: replace with a Sendable copy of row
/// The row that could not be decoded
let row: Row
@@ -112,6 +113,11 @@ enum RowDecodingError: Error {
}
}
#if compiler(>=5.5.1)
extension RowKey: Sendable { }
extension RowDecodingError.Context: Sendable { }
#endif
@usableFromInline
struct RowDecodingContext {
/// The row that is decoded
+4
View File
@@ -880,3 +880,7 @@ extension StatementArguments {
return "[" + (namedValuesDescriptions + valuesDescriptions).joined(separator: ", ") + "]"
}
}
#if compiler(>=5.5.1)
extension StatementArguments: Sendable { }
#endif
+1 -1
View File
@@ -251,7 +251,7 @@ public struct DatabaseMigrator {
/// - throws: An eventual error thrown by the registered migration blocks.
@available(macOS 12, iOS 15, tvOS 15, watchOS 8, *)
public func migrate(_ writer: DatabaseWriter, upTo targetIdentifier: String) async throws {
try await writer.barrierWriteWithoutTransaction { db in
try await writer.barrierWriteWithoutTransaction { [self] db in
try migrate(db, upTo: targetIdentifier)
}
}
+1 -1
View File
@@ -493,7 +493,7 @@ extension ColumnDecoder: SingleValueDecodingContainer {
}
@available(macOS 10.12, watchOS 3.0, tvOS 10.0, *)
private var iso8601Formatter: ISO8601DateFormatter = {
private let iso8601Formatter: ISO8601DateFormatter = {
let formatter = ISO8601DateFormatter()
formatter.formatOptions = .withInternetDateTime
return formatter