I’ve taken some time to digest the current feedback and I’ve changed my mind. The syntax for adding constraints to a sub-protocol in the protocol’s definition where clause is starting to grow on me. Before I modify the proposal, I'd still like to understand something:
What is the use of declaring a default associated types with the `=` syntax in protocols? I’ve never used them and I don’t understand what they provide. > On 26 Apr 2016, at 15:53, Douglas Gregor <dgre...@apple.com> wrote: > > > > Sent from my iPhone > > On Apr 25, 2016, at 10:03 PM, Brent Royal-Gordon <br...@architechies.com> > wrote: > >>> Note that, if we do the above, I’d love to make it an error to define a new >>> associated type with the same name as an associated type in an inherited >>> protocol. It’s odd that we do so, and IIRC the only use case for it is to >>> add requirement to an “existing” associated type. >> >> You also do it to specify or change a default associated type. This is from >> an older copy of the stdlib source code, but I believe there's still >> something equivalent: >> >> public protocol CollectionType : Indexable, SequenceType { >> associatedtype Generator: GeneratorType = IndexingGenerator<Self> > > Ah yes, of course! Thank you. > > - Doug _______________________________________________ swift-evolution mailing list swift-evolution@swift.org https://lists.swift.org/mailman/listinfo/swift-evolution