Avatar
@swift-main -swift-version 6 protocol P { static func doSomething() } struct S: @MainActor P { static func doSomething() { MainActor.assertIsolated() print("S", #function) } } struct S2: P { static func doSomething() { print("S2", #function) } } func useP(_ v: any P.Type) async { await Task.detached { v.doSomething() }.value } await useP(S2.self) await useP(S.self) (edited)