Avatar
@swift-6.2-dev -swift-version 6 protocol P { static func doSomething() } struct S: @MainActor P { static func doSomething() { MainActor.assertIsolated() } } struct S2: P { static func doSomething() {} } func useSendable(_ v: some Sendable) async { await Task.detached { if let v = v as? any P.Type { v.doSomething() print(v, "is P.Type") } else { print(v, "is not P.Type") } }.value } func useP(_ v: any P.Type) async { await useAny(v) } func useAny(_ v: Any.Type) async { await useSendable(v) } await useP(S2.self) await useP(S.self) (edited)