Re: [swift-evolution] Why doesn't Collection's SubSequence conform to Collection?

2017-03-07 Thread Douglas Gregor via swift-evolution
> On Feb 24, 2017, at 7:49 AM, Davide Mendolia wrote: > > What's the status of Recursive protocol constraints? it's a feature that will > help the design of a library I'm working on. It’s a surprisingly intricate feature that’s required some major refactoring in the

Re: [swift-evolution] Why doesn't Collection's SubSequence conform to Collection?

2017-02-24 Thread Davide Mendolia via swift-evolution
What's the status of Recursive protocol constraints? it's a feature that will help the design of a library I'm working on. How can I help ? On Tue, Feb 14, 2017 at 1:32 AM Douglas Gregor via swift-evolution < swift-evolution@swift.org> wrote: > > On Feb 13, 2017, at 1:42 PM, Charles Srstka via

Re: [swift-evolution] Why doesn't Collection's SubSequence conform to Collection?

2017-02-13 Thread Douglas Gregor via swift-evolution
> On Feb 13, 2017, at 1:42 PM, Charles Srstka via swift-evolution > wrote: > > The following comment accompanies the declaration of the SubSequence > associated type in the Collection protocol: > > /// A sequence that represents a contiguous subrange of the

Re: [swift-evolution] Why doesn't Collection's SubSequence conform to Collection?

2017-02-13 Thread Huon Wilson via swift-evolution
The lines just after the current declaration show the desired version, which is waiting on two generics features that are in the pipeline: // FIXME(ABI)#98 (Recursive Protocol Constraints): // FIXME(ABI)#99 (Associated Types with where clauses): // associatedtype SubSequence : Collection

Re: [swift-evolution] Why doesn't Collection's SubSequence conform to Collection?

2017-02-13 Thread Max Moiseev via swift-evolution
Because it would be recursive. which is not supported, I believe. protocol Foo { associatedtype Bar : Foo } Playground execution failed: error: MyPlayground.playground:2:20: error: type may not reference itself as a requirement associatedtype Bar : Foo ^ > On Feb

[swift-evolution] Why doesn't Collection's SubSequence conform to Collection?

2017-02-13 Thread Charles Srstka via swift-evolution
The following comment accompanies the declaration of the SubSequence associated type in the Collection protocol: /// A sequence that represents a contiguous subrange of the collection's /// elements. /// /// This associated type appears as a requirement in the `Sequence` /// protocol, but it is