Skip to content

Add Sendable to Date, DateComponents and Data #4777

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Darwin/Foundation-swiftoverlay/Date.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import CoreFoundation

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
Expand Down
2 changes: 1 addition & 1 deletion Darwin/Foundation-swiftoverlay/DateComponents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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, @unchecked Sendable, _MutableBoxing {
public typealias ReferenceType = NSDateComponents

internal var _handle: _MutableHandle<NSDateComponents>
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/Data.swift
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ internal class __NSSwiftData : NSData {
}

@frozen
public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessCollection, MutableCollection, RangeReplaceableCollection, MutableDataProtocol, ContiguousBytes {
public struct Data : ReferenceConvertible, Equatable, Hashable, RandomAccessCollection, MutableCollection, RangeReplaceableCollection, MutableDataProtocol, ContiguousBytes, @unchecked Sendable {
public typealias ReferenceType = NSData

public typealias ReadingOptions = NSData.ReadingOptions
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/UUID.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public typealias uuid_t = (UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt8, UInt
public typealias uuid_string_t = (Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8, Int8)

/// Represents UUID strings, which can be used to uniquely identify types, interfaces, and other items.
public struct UUID : ReferenceConvertible, Hashable, Equatable, CustomStringConvertible {
public struct UUID : ReferenceConvertible, Hashable, Equatable, CustomStringConvertible, Sendable {
public typealias ReferenceType = NSUUID

public private(set) var uuid: uuid_t = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
Expand Down