Sorry, 'with' in the second example should be 'where'. My personal preference is to keep 'where' for both uses, since they are serving the same purpose.
> On May 28, 2016, at 10:33 AM, Austin Zheng <[email protected]> wrote: >> >> -Thorsten > > We could make parentheses optional in the general case, and just have them > mandatory in the following situations: > > - You want to nest an existential literal inside another existential literal: > let a : Protocol1, (Protocol2 where .Blah == Int), Protocol3 = foo() > > - You want to return an existential with more than one term and/or a where > clause from a function that has a generic where clause > func foo<P, Q>(p: P, q: Q) -> (Collection with .Element == P) where P : > Equatable { ... } > > - You want to use an existential as a function argument, and that existential > has more than one term and/or a where clause > func foo(x: Protocol1, y: (Protocol2 where .Blah == Int), z: Protocol3) { ... > } > > Would that be a reasonable compromise?
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
