Avatar
@swift-main protocol P {} extension Int: P {} func useP(_ p: some P) {} struct S: P { init(builder: () -> ()) { } } extension P where Self == S { static func s(builder: () -> ()) -> Self { S(builder: builder) } } func main() { useP(S { 1 2 3 }) useP(.s { 1 2 3 }) }