Avatar
@swift-main protocol P { func foo() -> Int } struct S: P { func foo() -> Int { 42 } } func useP(_ p: some P) { print(p.foo()) } let p: any P = S() useP(p) (edited)