<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 7, 2017, at 12:46 AM, Jens Persson <<a href="mailto:jens@bitcycle.com" class="">jens@bitcycle.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Ok, I thought it was part of SE-0142 (which has status "implemented (Swift 4)”.</div></div></blockquote><div><br class=""></div>That’s just the where clause part. There’s still plenty you can accomplish with them even if they do not introduce recursive conformances :)</div><div><br class=""></div><div>Slava</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class="">/Jens</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Jun 7, 2017 at 9:39 AM, Slava Pestov <span dir="ltr" class=""><<a href="mailto:spestov@apple.com" target="_blank" class="">spestov@apple.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is a rather complex feature that is not actually implemented in Swift 4 (or Swift 3 for that matter). Work is underway to support this, though. The fact that the second example does not produce a diagnostic is a bug (probably you will not be able to define a type that conforms to P2 anyway).<br class="">
<br class="">
The proposal is here if you’d like to read more about it: <a href="https://github.com/apple/swift-evolution/blob/master/proposals/0157-recursive-protocol-constraints.md" rel="noreferrer" target="_blank" class="">https://github.com/apple/<wbr class="">swift-evolution/blob/master/<wbr class="">proposals/0157-recursive-<wbr class="">protocol-constraints.md</a><br class="">
<br class="">
Slava<br class="">
<div class=""><div class="h5"><br class="">
> On Jun 6, 2017, at 10:37 PM, Jens Persson via swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>> wrote:<br class="">
><br class="">
> In Swift 4:<br class="">
><br class="">
> protocol P1 {<br class="">
> associatedtype A: P1 // Error: Type may not reference itself as a requirement<br class="">
> }<br class="">
> protocol P2 {<br class="">
> associatedtype A where A: P2 // OK<br class="">
> }<br class="">
><br class="">
> What is the rationale behind this?<br class="">
><br class="">
> /Jens<br class="">
</div></div>> ______________________________<wbr class="">_________________<br class="">
> swift-users mailing list<br class="">
> <a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">
> <a href="https://lists.swift.org/mailman/listinfo/swift-users" rel="noreferrer" target="_blank" class="">https://lists.swift.org/<wbr class="">mailman/listinfo/swift-users</a><br class="">
<br class="">
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>