From 283fbf00fdffd64c924b6cb22c84e803b718f078 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Fri, 7 Aug 2026 17:33:46 -0500 Subject: Adopt Swift 6 language mode Flip SWIFT_VERSION to 6.0 (keeping SWIFT_DEFAULT_ACTOR_ISOLATION = MainActor) and resolve every resulting diagnostic. Mechanical, no behaviour change: - Models: pure value types in Models/ and utility extensions (Date, DateFormatter, SRHTWebURL) marked nonisolated so the nonisolated networking layer can use them. - App Intents: stored 'static var' (title/description/openAppWhenRun/ typeDisplayRepresentation/defaultQuery/caseDisplayRepresentations) -> 'static let'; drop the invalid @retroactive on the in-module LookupType: AppEnum. - Sendable dicts: 'nil as String? as Any' -> 'nil as String? as any Sendable'. - UserDefaults: retroactive @unchecked Sendable (documented thread-safe). - WidgetKit completion handlers rebound nonisolated(unsafe) to cross into Task {}; TipStoreViewModel task handle is @ObservationIgnored nonisolated(unsafe) for its nonisolated deinit. - Tests run on @MainActor; a few constant fixtures marked nonisolated for use in @Sendable stub closures. Builds and the full suite are clean in Swift 6 mode. Roadmap updated. --- Hutch/Models/Patchset.swift | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Hutch/Models/Patchset.swift') diff --git a/Hutch/Models/Patchset.swift b/Hutch/Models/Patchset.swift index 330bbbc..cc10b35 100644 --- a/Hutch/Models/Patchset.swift +++ b/Hutch/Models/Patchset.swift @@ -1,7 +1,7 @@ import Foundation /// Review state of a patchset on lists.sr.ht. -enum PatchsetStatus: String, Codable, Sendable, CaseIterable { +nonisolated enum PatchsetStatus: String, Codable, Sendable, CaseIterable { case unknown = "UNKNOWN" case proposed = "PROPOSED" case needsRevision = "NEEDS_REVISION" @@ -55,7 +55,7 @@ enum PatchsetStatus: String, Codable, Sendable, CaseIterable { /// A patchset as it appears in a mailing list listing, derived from the thread's /// root email rather than a dedicated patchsets query — `MailingList` exposes no /// such field. -struct PatchsetSummary: Identifiable, Hashable, Sendable { +nonisolated struct PatchsetSummary: Identifiable, Hashable, Sendable { let id: Int let subject: String let version: Int @@ -70,7 +70,7 @@ struct PatchsetSummary: Identifiable, Hashable, Sendable { } /// One email within a patchset: either the cover letter or a single patch. -struct PatchsetEmail: Identifiable, Hashable, Sendable { +nonisolated struct PatchsetEmail: Identifiable, Hashable, Sendable { let id: Int let subject: String let date: Date? @@ -88,13 +88,13 @@ struct PatchsetEmail: Identifiable, Hashable, Sendable { } /// A build or check reported against a patchset. -struct PatchsetToolResult: Identifiable, Hashable, Sendable { +nonisolated struct PatchsetToolResult: Identifiable, Hashable, Sendable { let id: Int let icon: PatchsetToolIcon let details: String } -enum PatchsetToolIcon: String, Codable, Sendable { +nonisolated enum PatchsetToolIcon: String, Codable, Sendable { case pending = "PENDING" case waiting = "WAITING" case success = "SUCCESS" @@ -112,7 +112,7 @@ enum PatchsetToolIcon: String, Codable, Sendable { } /// A patchset with its cover letter, patches, and review context. -struct PatchsetDetail: Sendable { +nonisolated struct PatchsetDetail: Sendable { let id: Int let created: Date let updated: Date -- cgit v1.2.3