I gave some code that looks like this:
protocol PAT {
associatedtype R
}
protocol Foo {
associatedtype Body: PAT
func body<Bar: PAT>(for bar: Bar) -> Body
}
And I'm wondering why this doesn't work:
struct Baz: Foo {
func body<Bar: PAT>(for bar: Bar) -> some PAT {
}
}
This generates a compiler error: Baz doesn't conform to Foo.
BigSur
({ @MainActor in M1.Ultra }(Swift))
2
Body != some PAT It can be anything, a concrete type or a protocol.