<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span style="font-size:12.8px">I don&#39;t think there&#39;s much of a point solving this just for associated types. The same issue exists for all protocol requirements.</span></blockquote><div><br></div><div>True enough. The one difference worth noting, however, is that there&#39;s no way to address the ambiguity of identical protocol requirements without adding syntactical overhead. In the case of associatedtype inferencing, however, it should be possible.</div><div><br></div><div>







<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class=""><span style="font-size:12.8px">Then don&#39;t do that. Absurdly short associated/generic type names are like absurdly short variable or function names—they&#39;re okay in a very small context like a short function or a single loop, but a bad idea in a wider context. That&#39;s why the Swift 2 standard library moved away from using short names like `T` in generic types like Array and Optional.</span></span></blockquote><p class=""><span class="">While this may be a bit orthogonal, it&#39;s worth noting that the standard library has increased its usage of T over the past month. Right now, it contains </span>3932 occurrences of &lt;T&gt;. Plenty of these usages are type-scoped. To your point, there are only 46 occurrences of &quot;associatedtype T&quot;.</p><p class="">Regardless, there are plenty of longer, arguably better associatedtype names that writers of different packages may commonly reach for. &quot;Element&quot; may be known to be somewhat off limits, but it is representative of this category.</p></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 6, 2016 at 1:45 AM, Brent Royal-Gordon <span dir="ltr">&lt;<a href="mailto:brent@architechies.com" target="_blank">brent@architechies.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">&gt; Types associated with a protocol are not namespaced by the protocol, but rather by the protocol&#39;s adopters. As such, when two protocols declare a common associatedType, adoption of those protocols introduces undesirable ambiguity.<br>
<br>
</span>I don&#39;t think there&#39;s much of a point solving this just for associated types. The same issue exists for all protocol requirements.<br>
<span class=""><br>
&gt; Given the understandable propensity of developers to arrive at similarly named types (T, for example), it is likely that this problem will reduce the compatibility of packages for reasons that may not be entirely clear to the package consumer.<br>
<br>
</span>Then don&#39;t do that. Absurdly short associated/generic type names are like absurdly short variable or function names—they&#39;re okay in a very small context like a short function or a single loop, but a bad idea in a wider context. That&#39;s why the Swift 2 standard library moved away from using short names like `T` in generic types like Array and Optional.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Brent Royal-Gordon<br>
Architechies<br>
<br>
</font></span></blockquote></div><br></div>