Skip to content

Commit 7aefa12

Browse files
committed
WIP
bugfix/build-errors-with-swift-6-2
1 parent 8e9ede2 commit 7aefa12

15 files changed

Lines changed: 159 additions & 141 deletions

Sources/CoreDataRepository/CoreDataRepository+Aggregate.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// This source code is licensed under the MIT License (MIT) found in the
55
// LICENSE file in the root directory of this source tree.
66

7-
import CoreData
7+
@preconcurrency import CoreData
88
import Foundation
99

1010
// swiftlint:disable file_length

Sources/CoreDataRepository/CoreDataRepository+Fetch.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// This source code is licensed under the MIT License (MIT) found in the
55
// LICENSE file in the root directory of this source tree.
66

7-
import CoreData
7+
@preconcurrency import CoreData
88
import Foundation
99

1010
extension CoreDataRepository {

Sources/CoreDataRepository/CoreDataRepository+Read_Batch.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ extension CoreDataRepository {
9595
/// This operation is non-atomic. Each instance may succeed or fail individually.
9696
@inlinable
9797
public func readAtomically<Model: IdentifiedUnmanagedModel>(
98-
_ ids: some Sequence<Model.UnmanagedId>,
98+
_ ids: some Sequence<Model.UnmanagedId> & Sendable,
9999
as _: Model.Type
100100
) async -> Result<[Model], CoreDataError> {
101101
let context = Transaction.current?.context ?? context
@@ -115,7 +115,7 @@ extension CoreDataRepository {
115115
/// This operation is non-atomic. Each instance may succeed or fail individually.
116116
@inlinable
117117
public func readAtomically<Model: ReadableUnmanagedModel>(
118-
_ items: some Sequence<Model>
118+
_ items: some Sequence<Model> & Sendable
119119
) async -> Result<[Model], CoreDataError> {
120120
let context = Transaction.current?.context ?? context
121121
return await context.performInChild(schedule: .enqueued) { readContext in
@@ -134,7 +134,7 @@ extension CoreDataRepository {
134134
/// This operation is non-atomic. Each instance may succeed or fail individually.
135135
@inlinable
136136
public func readAtomically<Model: FetchableUnmanagedModel>(
137-
_ managedIds: some Sequence<NSManagedObjectID>,
137+
_ managedIds: some Sequence<NSManagedObjectID> & Sendable,
138138
as _: Model.Type
139139
) async -> Result<[Model], CoreDataError> {
140140
let context = Transaction.current?.context ?? context
@@ -154,7 +154,7 @@ extension CoreDataRepository {
154154
/// This operation is non-atomic. Each instance may succeed or fail individually.
155155
@inlinable
156156
public func readAtomically<Model: FetchableUnmanagedModel>(
157-
_ managedIdUrls: some Sequence<URL>,
157+
_ managedIdUrls: some Sequence<URL> & Sendable,
158158
as _: Model.Type
159159
) async -> Result<[Model], CoreDataError> {
160160
let context = Transaction.current?.context ?? context

Sources/CoreDataRepository/Internal/AggregateSubscription.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// This source code is licensed under the MIT License (MIT) found in the
55
// LICENSE file in the root directory of this source tree.
66

7-
import CoreData
7+
@preconcurrency import CoreData
88
import Foundation
99

1010
/// Subscription provider that sends updates when an aggregate fetch request changes

Sources/CoreDataRepository/Internal/AggregateThrowingSubscription.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// This source code is licensed under the MIT License (MIT) found in the
55
// LICENSE file in the root directory of this source tree.
66

7-
import CoreData
7+
@preconcurrency import CoreData
88
import Foundation
99

1010
/// Subscription provider that sends updates when an aggregate fetch request changes

Sources/CoreDataRepository/Internal/CountSubscription.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// This source code is licensed under the MIT License (MIT) found in the
55
// LICENSE file in the root directory of this source tree.
66

7-
import CoreData
7+
@preconcurrency import CoreData
88
import Foundation
99

1010
/// Subscription provider that sends updates when a count fetch request changes

Sources/CoreDataRepository/Internal/CountThrowingSubscription.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// This source code is licensed under the MIT License (MIT) found in the
55
// LICENSE file in the root directory of this source tree.
66

7-
import CoreData
7+
@preconcurrency import CoreData
88
import Foundation
99

1010
/// Subscription provider that sends updates when a count fetch request changes

Sources/CoreDataRepository/Internal/FetchSubscription.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// This source code is licensed under the MIT License (MIT) found in the
55
// LICENSE file in the root directory of this source tree.
66

7-
import CoreData
7+
@preconcurrency import CoreData
88
import Foundation
99

1010
/// Subscription provider that sends updates when a fetch request changes

Sources/CoreDataRepository/Internal/FetchThrowingSubscription.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// This source code is licensed under the MIT License (MIT) found in the
55
// LICENSE file in the root directory of this source tree.
66

7-
import CoreData
7+
@preconcurrency import CoreData
88
import Foundation
99

1010
/// Subscription provider that sends updates when a fetch request changes

Tests/CoreDataRepositoryTests/AggregateTests.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import Testing
1212

1313
extension CoreDataRepositoryTests {
1414
@Suite
15-
struct AggregateTests: CoreDataTestSuite, @unchecked Sendable {
15+
struct AggregateTests: CoreDataTestSuite, Sendable {
1616
let container: NSPersistentContainer
1717
let repositoryContext: NSManagedObjectContext
1818
let repository: CoreDataRepository
1919

20-
let fetchRequest: NSFetchRequest<ManagedModel_UuidId> = {
20+
nonisolated(unsafe) let fetchRequest: NSFetchRequest<ManagedModel_UuidId> = {
2121
let request = UnmanagedModel_UuidId.managedFetchRequest()
2222
request.sortDescriptors = [NSSortDescriptor(keyPath: \ManagedModel_UuidId.int, ascending: true)]
2323
return request
@@ -34,7 +34,11 @@ extension CoreDataRepositoryTests {
3434
var objectIds = [NSManagedObjectID]()
3535

3636
mutating func extraSetup() async throws {
37-
let (_expectedValues, _objectIds) = try repositoryContext.performAndWait {
37+
let (_expectedValues, _objectIds) = try repositoryContext.performAndWait { [
38+
self,
39+
repositoryContext,
40+
values
41+
] in
3842
let managedMovies = try values
3943
.map {
4044
try ManagedIdUrlModel_UuidId(fetchable: $0)

0 commit comments

Comments
 (0)