<div dir="ltr">+1 for using a distinct keyword for associated types<br></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Dec 5, 2015 at 9:49 PM David Waite via swift-evolution <<a href="mailto:swift-evolution@swift.org">swift-evolution@swift.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">However, if a protocol wished to use type aliases not as part of a contract but for clarity, this would still need to be defined within the protocol in order for the associated types to be used in the typealias declarations.<br>
<br>
-DW<br>
<br>
> On Dec 5, 2015, at 7:29 PM, Dmitri Gribenko via swift-evolution <<a href="mailto:swift-evolution@swift.org" target="_blank">swift-evolution@swift.org</a>> wrote:<br>
><br>
> On Sat, Dec 5, 2015 at 6:27 PM, Loïc Lecrenier <<a href="mailto:loiclecrenier@icloud.com" target="_blank">loiclecrenier@icloud.com</a>> wrote:<br>
>> Great :)<br>
>><br>
>> Also, this hasn't been explicitly discussed yet. But do you all agree about adding "real" typealias declarations (with the typealias keyword) inside protocols?<br>
><br>
> Concrete typealieases are not requirements, so they shouldn't be<br>
> defined inside of a protocol. Instead, they should be defined in the<br>
> protocol extension. In fact, this has been a plan of record for some<br>
> time, but it wasn't implemented.<br>
><br>
> extension SequenceType {<br>
> typealias Element = Generator.Element<br>
> }<br>
><br>
> Dmitri<br>
><br>
> --<br>
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if<br>
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com" target="_blank">gribozavr@gmail.com</a>>*/<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>
<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>