Avatar
Avatar
Iceman
@swift-main -swift-version 6 protocol P {} struct S: @MainActor P {} struct S2: P {} func useSendable(_ v: some Sendable) { print(v, "is sendable.") } func useP(_ v: any P.Type) { useSendable(v) useAny(v) } func useAny(_ v: Any.Type) { useSendable(v) } useP(S.self) useP(S2.self)
swiftNightly BOT 8/21/2025 8:38 AM
S is sendable. S is sendable. S2 is sendable. S2 is sendable.<stdin>:10:5: warning: type '(any P).Type' does not conform to the 'Sendable' protocol 8 | } 9 | func useP(_ v: any P.Type) { 10 | useSendable(v) | `- warning: type '(any P).Type' does not conform to the 'Sendable' protocol 11 | useAny(v) 12 | }