From 64b4a4b97c803cfac1d56e5669726baecf5a0f31 Mon Sep 17 00:00:00 2001 From: Franz Busch Date: Mon, 25 Sep 2023 17:41:03 +0100 Subject: [PATCH] Make `Date`, `DateComponents` and `DateInterval` `Sendable` # Motivation In https://github.com/apple/swift-corelibs-foundation/pull/4777, I made them `Sendable` in the overlay instead of the real `Foundation` module. This PR fixes that. --- Sources/Foundation/Date.swift | 2 +- Sources/Foundation/DateComponents.swift | 2 +- Sources/Foundation/DateInterval.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Foundation/Date.swift b/Sources/Foundation/Date.swift index efd3e26774..f6ec9110e1 100644 --- a/Sources/Foundation/Date.swift +++ b/Sources/Foundation/Date.swift @@ -14,7 +14,7 @@ A `Date` is independent of a particular calendar or time zone. To represent a `Date` to a user, you must interpret it in the context of a `Calendar`. */ -public struct Date : ReferenceConvertible, Comparable, Equatable { +public struct Date : ReferenceConvertible, Comparable, Equatable, Sendable { public typealias ReferenceType = NSDate fileprivate var _time: TimeInterval diff --git a/Sources/Foundation/DateComponents.swift b/Sources/Foundation/DateComponents.swift index e0b20fab2e..c79baf8893 100644 --- a/Sources/Foundation/DateComponents.swift +++ b/Sources/Foundation/DateComponents.swift @@ -19,7 +19,7 @@ When a new instance of `DateComponents` is created, the date components are set to `nil`. */ -public struct DateComponents : ReferenceConvertible, Hashable, Equatable, _MutableBoxing { +public struct DateComponents : ReferenceConvertible, Hashable, Equatable, Sendable, _MutableBoxing { public typealias ReferenceType = NSDateComponents internal var _handle: _MutableHandle diff --git a/Sources/Foundation/DateInterval.swift b/Sources/Foundation/DateInterval.swift index b9ac332ced..8e4990c8f9 100644 --- a/Sources/Foundation/DateInterval.swift +++ b/Sources/Foundation/DateInterval.swift @@ -13,7 +13,7 @@ @_implementationOnly import CoreFoundation /// DateInterval represents a closed date interval in the form of [startDate, endDate]. It is possible for the start and end dates to be the same with a duration of 0. DateInterval does not support reverse intervals i.e. intervals where the duration is less than 0 and the end date occurs earlier in time than the start date. -public struct DateInterval : ReferenceConvertible, Comparable, Hashable { +public struct DateInterval : ReferenceConvertible, Comparable, Sendable, Hashable { public typealias ReferenceType = NSDateInterval /// The start date.