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 <
[email protected]> wrote:

>
> On Feb 13, 2017, at 1:42 PM, Charles Srstka via swift-evolution <
> [email protected]> 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 collection's
> /// elements.
> ///
> /// This associated type appears as a requirement in the `Sequence`
> /// protocol, but it is restated here with stricter constraints. In a
> /// collection, the subsequence should also conform to `Collection`.
> associatedtype SubSequence : IndexableBase, Sequence = Slice<Self>
>
> The comments clearly state that the subsequence should conform to
> Collection, however, it is not declared as such. Why is this?
>
>
> The compiler doesn’t support “recursive” constraints. We’re working on it
>
> https://gist.github.com/DougGregor/e7c4e7bb4465d6f5fa2b59be72dbdba6
>
>
> - Doug
>
>
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution
>
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to