Skip to content

Commit

Permalink
Swift 6
Browse files Browse the repository at this point in the history
  • Loading branch information
lickel committed Aug 30, 2024
1 parent 4f8ad8a commit 1a61494
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 22 deletions.
8 changes: 2 additions & 6 deletions FetchRequests.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1286,10 +1286,8 @@
SKIP_INSTALL = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_UPCOMING_FEATURE_INFER_SENDABLE_FROM_CAPTURES = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "";
TVOS_DEPLOYMENT_TARGET = 13.0;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -1366,10 +1364,8 @@
SKIP_INSTALL = YES;
SWIFT_COMPILATION_MODE = wholemodule;
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_STRICT_CONCURRENCY = complete;
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
SWIFT_UPCOMING_FEATURE_INFER_SENDABLE_FROM_CAPTURES = YES;
SWIFT_VERSION = 5.0;
SWIFT_VERSION = 6.0;
TARGETED_DEVICE_FAMILY = "";
TVOS_DEPLOYMENT_TARGET = 13.0;
VALIDATE_PRODUCT = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class FetchRequestAssociation<FetchedObject: FetchableObject> {
_ completion: @escaping @MainActor ([AssociatedEntity]) -> Void
) -> Void
/// Event that represents the creation of an associated value object
public typealias CreationObserved<Value, Comparison> = (Value?, Comparison) -> AssociationReplacement<Value>
public typealias CreationObserved<Value, Comparison> = @MainActor (Value?, Comparison) -> AssociationReplacement<Value>
/// Start observing a source object
public typealias TokenGenerator<Source, Token: ObservableToken> = (Source) -> Token?

Expand Down
10 changes: 5 additions & 5 deletions FetchRequests/Sources/Logging.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ func CWLogVerbose(
_ message: @autoclosure () -> String,
level: DDLogLevel = dynamicLogLevel,
context: Int = 0,
file: StaticString = #file,
file: StaticString = #filePath,
function: StaticString = #function,
line: UInt = #line,
tag: Any? = nil,
Expand All @@ -39,7 +39,7 @@ func CWLogDebug(
_ message: @autoclosure () -> String,
level: DDLogLevel = dynamicLogLevel,
context: Int = 0,
file: StaticString = #file,
file: StaticString = #filePath,
function: StaticString = #function,
line: UInt = #line,
tag: Any? = nil,
Expand All @@ -63,7 +63,7 @@ func CWLogInfo(
_ message: @autoclosure () -> String,
level: DDLogLevel = dynamicLogLevel,
context: Int = 0,
file: StaticString = #file,
file: StaticString = #filePath,
function: StaticString = #function,
line: UInt = #line,
tag: Any? = nil,
Expand All @@ -87,7 +87,7 @@ func CWLogWarning(
_ message: @autoclosure () -> String,
level: DDLogLevel = dynamicLogLevel,
context: Int = 0,
file: StaticString = #file,
file: StaticString = #filePath,
function: StaticString = #function,
line: UInt = #line,
tag: Any? = nil,
Expand All @@ -111,7 +111,7 @@ func CWLogError(
_ message: @autoclosure () -> String,
level: DDLogLevel = dynamicLogLevel,
context: Int = 0,
file: StaticString = #file,
file: StaticString = #filePath,
function: StaticString = #function,
line: UInt = #line,
tag: Any? = nil,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ extension CollapsibleSectionsFetchedResultsControllerTestCase {

extension CollapsibleSectionsFetchedResultsControllerTestCase {
@MainActor
private func setupControllerForKVO(_ file: StaticString = #file, line: UInt = #line) throws {
private func setupControllerForKVO(_ file: StaticString = #filePath, line: UInt = #line) throws {
controller = FetchController(
definition: createFetchDefinition(),
sortDescriptors: [
Expand Down Expand Up @@ -1323,14 +1323,14 @@ extension CollapsibleSectionsFetchedResultsControllerTestCase {

private extension CollapsibleSectionsFetchedResultsControllerTestCase {
@MainActor
func performFetch(_ objectIDs: [String], file: StaticString = #file, line: UInt = #line) throws {
func performFetch(_ objectIDs: [String], file: StaticString = #filePath, line: UInt = #line) throws {
let objects = objectIDs.compactMap { TestObject(id: $0) }

try performFetch(objects, file: file, line: line)
}

@MainActor
func performFetch(_ objects: [TestObject], file: StaticString = #file, line: UInt = #line) throws {
func performFetch(_ objects: [TestObject], file: StaticString = #filePath, line: UInt = #line) throws {
controller.performFetch()

self.fetchCompletion(objects)
Expand All @@ -1340,7 +1340,7 @@ private extension CollapsibleSectionsFetchedResultsControllerTestCase {
}

// swiftlint:disable:next implicitly_unwrapped_optional
func getObjectAtIndex(_ index: Int, withObjectID objectID: String, file: StaticString = #file, line: UInt = #line) -> TestObject! {
func getObjectAtIndex(_ index: Int, withObjectID objectID: String, file: StaticString = #filePath, line: UInt = #line) -> TestObject! {
let object = controller.fetchedObjects[index]

XCTAssertEqual(object.id, objectID, file: file, line: line)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@ extension FetchedResultsControllerTestCase {

extension FetchedResultsControllerTestCase {
@MainActor
private func setupControllerForKVO(_ file: StaticString = #file, line: UInt = #line) throws {
private func setupControllerForKVO(_ file: StaticString = #filePath, line: UInt = #line) throws {
controller = FetchedResultsController(
definition: createFetchDefinition(),
sortDescriptors: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ protocol FetchedResultsControllerTestHarness {

extension FetchedResultsControllerTestHarness {
@MainActor
func performFetch(_ objectIDs: [String], file: StaticString = #file, line: UInt = #line) throws {
func performFetch(_ objectIDs: [String], file: StaticString = #filePath, line: UInt = #line) throws {
let objects = objectIDs.compactMap { TestObject(id: $0) }

try performFetch(objects, file: file, line: line)
}

@MainActor
func performFetch(_ objects: [TestObject], file: StaticString = #file, line: UInt = #line) throws {
func performFetch(_ objects: [TestObject], file: StaticString = #filePath, line: UInt = #line) throws {
controller.performFetch()

self.fetchCompletion(objects)
Expand All @@ -41,7 +41,7 @@ extension FetchedResultsControllerTestHarness {
}

// swiftlint:disable:next implicitly_unwrapped_optional
func getObjectAtIndex(_ index: Int, withObjectID objectID: String, file: StaticString = #file, line: UInt = #line) -> TestObject! {
func getObjectAtIndex(_ index: Int, withObjectID objectID: String, file: StaticString = #filePath, line: UInt = #line) -> TestObject! {
let object = controller.fetchedObjects[index]

XCTAssertEqual(object.id, objectID, file: file, line: line)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,14 @@ extension PaginatingFetchedResultsControllerTestCase: FetchedResultsControllerDe

private extension PaginatingFetchedResultsControllerTestCase {
@MainActor
func performPagination(_ objectIDs: [String], file: StaticString = #file, line: UInt = #line) {
func performPagination(_ objectIDs: [String], file: StaticString = #filePath, line: UInt = #line) {
let objects = objectIDs.compactMap { TestObject(id: $0) }

performPagination(objects, file: file, line: line)
}

@MainActor
func performPagination(_ objects: [TestObject], file: StaticString = #file, line: UInt = #line) {
func performPagination(_ objects: [TestObject], file: StaticString = #filePath, line: UInt = #line) {
controller.performPagination { hasPageResults in
self.performPaginationCompletionResult = hasPageResults
}
Expand Down

0 comments on commit 1a61494

Please sign in to comment.