Skip to content

Commit e04a8f8

Browse files
committed
Adapt to some changes in how unchecked Sendable conformance is declared
1 parent c5f3634 commit e04a8f8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+102
-169
lines changed

Sources/Foundation/AffineTransform.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ public struct NSAffineTransformStruct : Sendable {
413413
}
414414

415415
@available(*, unavailable)
416-
extension NSAffineTransform : Sendable { }
416+
extension NSAffineTransform : @unchecked Sendable { }
417417

418418
open class NSAffineTransform: NSObject {
419419
// Internal only for testing.

Sources/Foundation/ByteCountFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ extension ByteCountFormatter {
4040
}
4141

4242
@available(*, unavailable)
43-
extension ByteCountFormatter : Sendable { }
43+
extension ByteCountFormatter : @unchecked Sendable { }
4444

4545
open class ByteCountFormatter : Formatter {
4646
public override init() {

Sources/Foundation/CharacterSet.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ private func _utfRangeToNSRange(_ inRange : ClosedRange<UnicodeScalar>) -> NSRan
1818
return NSRange(location: Int(inRange.lowerBound.value), length: Int(inRange.upperBound.value - inRange.lowerBound.value + 1))
1919
}
2020

21-
internal final class _SwiftNSCharacterSet : NSCharacterSet, _SwiftNativeFoundationType, @unchecked Sendable {
21+
internal final class _SwiftNSCharacterSet : NSCharacterSet, _SwiftNativeFoundationType {
2222
internal typealias ImmutableType = NSCharacterSet
2323
internal typealias MutableType = NSMutableCharacterSet
2424

@@ -114,7 +114,7 @@ public struct CharacterSet : ReferenceConvertible, Equatable, Hashable, SetAlgeb
114114
internal typealias ImmutableType = SwiftNSWrapping.ImmutableType
115115
internal typealias MutableType = SwiftNSWrapping.MutableType
116116

117-
internal var _wrapped : _SwiftNSCharacterSet
117+
internal nonisolated(unsafe) var _wrapped : _SwiftNSCharacterSet
118118

119119
// MARK: Init methods
120120

Sources/Foundation/DispatchData+DataProtocol.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
import Dispatch
1515

1616
@available(*, unavailable)
17-
extension DispatchData.Region : Sendable { }
17+
extension DispatchData.Region : @unchecked Sendable { }
1818

1919
extension DispatchData : DataProtocol {
2020
public typealias Regions = [Region]

Sources/Foundation/EnergyFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ extension EnergyFormatter {
6161
}
6262

6363
@available(*, unavailable)
64-
extension EnergyFormatter : Sendable { }
64+
extension EnergyFormatter : @unchecked Sendable { }
6565

6666
open class EnergyFormatter: Formatter {
6767

Sources/Foundation/FileManager.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -608,12 +608,6 @@ extension FileAttributeKey {
608608
internal static let _accessDate = FileAttributeKey(rawValue: "org.swift.Foundation.FileAttributeKey._accessDate")
609609
}
610610

611-
@available(*, unavailable)
612-
extension FileManager.DirectoryEnumerator : Sendable { }
613-
614-
@available(*, unavailable)
615-
extension FileManager.NSPathDirectoryEnumerator : Sendable { }
616-
617611
extension FileManager {
618612
open class DirectoryEnumerator : NSEnumerator {
619613

Sources/Foundation/Formatter.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ extension Formatter {
4343
}
4444
}
4545

46-
@available(*, unavailable)
47-
extension Formatter : Sendable { }
48-
46+
//@_nonSendable
4947
open class Formatter : NSObject, NSCopying, NSCoding {
5048

5149
public override init() {

Sources/Foundation/Host.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ import WinSDK
5656
#endif
5757

5858
@available(*, unavailable)
59-
extension Host : Sendable { }
59+
extension Host : @unchecked Sendable { }
6060

6161
open class Host: NSObject {
6262
enum ResolveType {

Sources/Foundation/ISO8601DateFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ extension ISO8601DateFormatter {
4949
}
5050

5151
@available(*, unavailable)
52-
extension ISO8601DateFormatter : Sendable { }
52+
extension ISO8601DateFormatter : @unchecked Sendable { }
5353

5454
open class ISO8601DateFormatter : Formatter, NSSecureCoding {
5555

Sources/Foundation/JSONSerialization.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ extension JSONSerialization {
5454
*/
5555

5656
@available(*, unavailable)
57-
extension JSONSerialization : Sendable { }
57+
extension JSONSerialization : @unchecked Sendable { }
5858

5959
open class JSONSerialization : NSObject {
6060

0 commit comments

Comments
 (0)