<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Would that even compile? I thought I'd remembered getting an "illegal redefinition of T" or some such error, but maybe I'm misremembering (plus, I haven't tried in a really long time).</div><div id="AppleMailSignature"><br></div><div id="AppleMailSignature">- Dave Sweeris&nbsp;</div><div id="AppleMailSignature"><br></div><div>On Jun 24, 2017, at 08:48, Xiaodi Wu &lt;<a href="mailto:xiaodi.wu@gmail.com">xiaodi.wu@gmail.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div>For every Bar.T that is currently distinct from Foo.T, this would be source-breaking.<br><div class="gmail_quote"><div dir="ltr">On Sat, Jun 24, 2017 at 01:51 David Sweeris via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
&gt; On Jun 23, 2017, at 5:28 PM, David Moore via swift-evolution &lt;<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>&gt; wrote:<br>
&gt;<br>
&gt; I do indeed have quite a few real examples of this, such prompted me to bring this up. I think this could be done without any impact to existing code, but it would require some type of keyword. Take the following as a possible prototype.<br>
&gt;<br>
&gt; protocol Foo {<br>
&gt;&nbsp; &nbsp; &nbsp;associatedtype T<br>
&gt; }<br>
&gt;<br>
&gt; struct Bar&lt;T&gt; : Foo {<br>
&gt;&nbsp; &nbsp; &nbsp;keyword typealias T // Or really any other syntactical implementation.<br>
&gt; }<br>
&gt;<br>
&gt; With an opt-in method we could implement this without affecting existing code, thereby making this more viable. I will send some examples later.<br>
<br>
At one point there was talk of just having generic parameters automatically becoming typealiases:<br>
struct Bar&lt;T&gt; : Foo {<br>
&nbsp; &nbsp; // `T` is automatically an implicit typealias for, well, `T`<br>
}<br>
<br>
Dunno if that’s still the plan (or to what degree it ever was), but it’d work for me. I don’t even think it’d break source compatibility (though it may make a lot of typealiases unneeded.<br>
<br>
- Dave Sweeris<br>
_______________________________________________<br>
swift-evolution mailing list<br>
<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a><br>
<a href="https://lists.swift.org/mailman/listinfo/swift-evolution" rel="noreferrer" target="_blank">https://lists.swift.org/mailman/listinfo/swift-evolution</a><br>
</blockquote></div>
</div></blockquote></body></html>