Avatar
Avatar
omochimetaru
@swift-5.5.3 protocol P {} protocol Q {} struct S: P {} extension Q { func p() -> some P { return S() } } func foo(q: Q) -> some P { return q.p() }
exit status: 1 with stderr:<stdin>:8:10: error: member 'p' cannot be used on value of protocol type 'Q'; use a generic constraint instead return q.p() ^ ~