Skip to content

Commit 64b4a4b

Browse files
committed
Make Date, DateComponents and DateInterval Sendable
# Motivation In swiftlang#4777, I made them `Sendable` in the overlay instead of the real `Foundation` module. This PR fixes that.
1 parent f07fa9f commit 64b4a4b

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Diff for: Sources/Foundation/Date.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
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`.
1616
*/
17-
public struct Date : ReferenceConvertible, Comparable, Equatable {
17+
public struct Date : ReferenceConvertible, Comparable, Equatable, Sendable {
1818
public typealias ReferenceType = NSDate
1919

2020
fileprivate var _time: TimeInterval

Diff for: Sources/Foundation/DateComponents.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
When a new instance of `DateComponents` is created, the date components are set to `nil`.
2121
*/
22-
public struct DateComponents : ReferenceConvertible, Hashable, Equatable, _MutableBoxing {
22+
public struct DateComponents : ReferenceConvertible, Hashable, Equatable, Sendable, _MutableBoxing {
2323
public typealias ReferenceType = NSDateComponents
2424

2525
internal var _handle: _MutableHandle<NSDateComponents>

Diff for: Sources/Foundation/DateInterval.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
@_implementationOnly import CoreFoundation
1414

1515
/// 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.
16-
public struct DateInterval : ReferenceConvertible, Comparable, Hashable {
16+
public struct DateInterval : ReferenceConvertible, Comparable, Sendable, Hashable {
1717
public typealias ReferenceType = NSDateInterval
1818

1919
/// The start date.

0 commit comments

Comments
 (0)