Avatar
Avatar
ジュニア
@swift-5.10.1 @swift-6.0.3 -swift-version 6 class NonSendable {} struct Bar: Sendable { var value: any Sendable } func useBar() { _ = Bar(value: NonSendable()) }
exit status: 1 with <stdin>:7:20: error: type 'NonSendable' does not conform to the 'Sendable' protocol 1 | class NonSendable {} | `- note: class 'NonSendable' does not conform to the 'Sendable' protocol 2 | struct Bar: Sendable { 3 | var value: any Sendable : 5 | 6 | func useBar() { 7 | _ = Bar(value: NonSendable()) | `- error: type 'NonSendable' does not conform to the 'Sendable' protocol 8 | } 9 |