Skip to content

Commit 17c9f46

Browse files
doozMenStijn Willems
authored andcommitted
workaround for compiler crash - no cloudkit for swift 6.3 at the moment (#4)
1 parent 1fc1792 commit 17c9f46

4 files changed

Lines changed: 268 additions & 208 deletions

File tree

Sources/SQLiteData/CloudKit/CloudKit+StructuredQueries.swift

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,29 @@
290290
typealias EquatableCKRecordValueProtocol = CKRecordValueProtocol & Equatable
291291

292292
self.userModificationTime = other.userModificationTime
293-
for column in T.TableColumns.writableColumns {
294-
func open<Value>(_ column: some WritableTableColumnExpression<T, Value>) {
293+
_update(
294+
with: other,
295+
row: row,
296+
columnNames: &columnNames,
297+
parentForeignKey: parentForeignKey,
298+
columns: T.TableColumns.writableColumns
299+
)
300+
}
301+
302+
private func _update<T: PrimaryKeyedTable>(
303+
with other: CKRecord,
304+
row: T,
305+
columnNames: inout [String],
306+
parentForeignKey: ForeignKey?,
307+
columns: [any WritableTableColumnExpression]
308+
) {
309+
typealias EquatableCKRecordValueProtocol = CKRecordValueProtocol & Equatable
310+
311+
for column in columns {
312+
func open<Root, Value>(_ column: some WritableTableColumnExpression<Root, Value>) {
295313
let key = column.name
296-
let keyPath = column.keyPath as! KeyPath<T, Value.QueryOutput>
314+
let column = column as! any WritableTableColumnExpression<T, Value>
315+
let keyPath = column.keyPath
297316
let didSet: Bool
298317
if let value = other[key] as? CKAsset {
299318
didSet = setAsset(value, forKey: key, at: other.encryptedValues[at: key])

0 commit comments

Comments
 (0)