mirror of
https://github.com/apple/swift.git
synced 2026-10-26 20:15:53 +01:00
40 lines
873 B
Swift
40 lines
873 B
Swift
|
|
public class NonSendableClass {}
|
|
|
|
@available(*, unavailable)
|
|
extension NonSendableClass: @unchecked Sendable {}
|
|
|
|
public struct SendableStruct: Sendable {}
|
|
|
|
public struct AnotherSendableStruct: Sendable {}
|
|
|
|
public protocol SendableSubProtocol: Sendable {}
|
|
|
|
public struct NonSendableViaProtocol {
|
|
public var value: Int = 0
|
|
public init() {}
|
|
}
|
|
|
|
@available(*, unavailable)
|
|
extension NonSendableViaProtocol: SendableSubProtocol {}
|
|
|
|
@_nonSendable
|
|
public struct NonSendableViaAttr {
|
|
public var value: Int = 0
|
|
public init() {}
|
|
}
|
|
|
|
public class NonSendableBase {}
|
|
|
|
@available(*, unavailable)
|
|
extension NonSendableBase: @unchecked Sendable {}
|
|
|
|
public class NonSendableChild: NonSendableBase {}
|
|
|
|
public protocol AnotherProtocol {}
|
|
|
|
public class NonSendableViaComposition {}
|
|
|
|
@available(*, unavailable)
|
|
extension NonSendableViaComposition: Sendable & AnotherProtocol {}
|