Skip to content

Adopt Swift 6 and audit for Sendable #5000

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 15 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Clarify comment of _nonSendable with a message explaining the remaini…
…ng warning
  • Loading branch information
parkera committed Jul 24, 2024
commit e16b39a4fd2c129bb7f8fce4bd992094aceadf14
2 changes: 1 addition & 1 deletion Sources/Foundation/Formatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ extension Formatter {
}
}

//@_nonSendable
//@_nonSendable - TODO: Mark with attribute to indicate this pure abstract class defers Sendable annotation to its subclasses.
open class Formatter : NSObject, NSCopying, NSCoding {

public override init() {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSCoder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public protocol NSSecureCoding : NSCoding {
/// is normally of the same class as the object that was originally encoded into
/// the stream. An object can change its class when encoded, however; this is
/// described in Archives and Serializations Programming Guide.
//@_nonSendable
//@_nonSendable - TODO: Mark with attribute to indicate this pure abstract class defers Sendable annotation to its subclasses.
open class NSCoder : NSObject {
internal var _pendingBuffers = Array<(UnsafeMutableRawPointer, Int)>()

Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSEnumerator.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
@available(*, unavailable)
extension NSEnumerator.Iterator : Sendable { }

//@_nonSendable
//@_nonSendable - TODO: Mark with attribute to indicate this pure abstract class defers Sendable annotation to its subclasses.
open class NSEnumerator : NSObject {

open func nextObject() -> Any? {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/NSObject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ extension NSMutableCopying {
}

/// The root class of most Foundation class hierarchies.
//@_nonSendable
//@_nonSendable - TODO: Mark with attribute to indicate this pure abstract class defers Sendable annotation to its subclasses.
open class NSObject : NSObjectProtocol, Equatable, Hashable {
// Important: add no ivars here. It will subvert the careful layout of subclasses that bridge into CF.

Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/Port.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ extension Port {
public static let didBecomeInvalidNotification = NSNotification.Name(rawValue: "NSPortDidBecomeInvalidNotification")
}

//@_nonSendable
//@_nonSendable - TODO: Mark with attribute to indicate this pure abstract class defers Sendable annotation to its subclasses.
open class Port : NSObject, NSCopying {
/// On Darwin, you can invoke `Port()` directly to produce a `MessagePort`. Since `MessagePort` is not available in swift-corelibs-foundation, you should not invoke this initializer directly. Subclasses of `Port` can delegate to this initializer safely.
public override init() {
Expand Down
2 changes: 1 addition & 1 deletion Sources/Foundation/Stream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ extension Stream {

// Stream is an abstract class encapsulating the common API to InputStream and OutputStream.
// Subclassers of InputStream and OutputStream must also implement these methods.
//@_nonSendable
//@_nonSendable - TODO: Mark with attribute to indicate this pure abstract class defers Sendable annotation to its subclasses.
open class Stream: NSObject {

public override init() {
Expand Down