<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 &lt;<a href="mailto:jens@bitcycle.com" class="">jens@bitcycle.com</a>&gt; 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="">&lt;<a href="mailto:spestov@apple.com" target="_blank" class="">spestov@apple.com</a>&gt;</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="">
&gt; On Jun 6, 2017, at 10:37 PM, Jens Persson via swift-users &lt;<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>&gt; wrote:<br class="">
&gt;<br class="">
&gt; In Swift 4:<br class="">
&gt;<br class="">
&gt; protocol P1 {<br class="">
&gt;&nbsp; &nbsp; &nbsp;associatedtype A: P1 // Error: Type may not reference itself as a requirement<br class="">
&gt; }<br class="">
&gt; protocol P2 {<br class="">
&gt;&nbsp; &nbsp; &nbsp;associatedtype A where A: P2 // OK<br class="">
&gt; }<br class="">
&gt;<br class="">
&gt; What is the rationale behind this?<br class="">
&gt;<br class="">
&gt; /Jens<br class="">
</div></div>&gt; ______________________________<wbr class="">_________________<br class="">
&gt; swift-users mailing list<br class="">
&gt; <a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a><br class="">
&gt; <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>