mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
44 lines
766 B
Swift
44 lines
766 B
Swift
import Foundation
|
|
|
|
// This input is useful to ensure the delegation status of
|
|
// an actor's initializer does not affect ABI stability
|
|
|
|
public protocol NamedEntity: Actor {
|
|
nonisolated var name: String? { get }
|
|
}
|
|
|
|
public actor BigFoot: NamedEntity {
|
|
|
|
public nonisolated let name: String?
|
|
|
|
private init(withName name: String) {
|
|
self.name = name
|
|
}
|
|
|
|
public init() {
|
|
#if DELEGATES
|
|
self.init(withName: "Sasquatch")
|
|
#else
|
|
self.name = nil
|
|
#endif
|
|
}
|
|
}
|
|
|
|
|
|
@objc public actor BigFootObjC: NSObject, NamedEntity {
|
|
|
|
public nonisolated let name: String?
|
|
|
|
private init(withName name: String) {
|
|
self.name = name
|
|
}
|
|
|
|
@objc public override init() {
|
|
#if DELEGATES
|
|
self.init(withName: "Sasquatch")
|
|
#else
|
|
self.name = nil
|
|
#endif
|
|
}
|
|
}
|