[swift-evolution] Introduce "associated_type" keyword

Loïc Lecrenier loiclecrenier at icloud.com
Sat Dec 5 20:31:41 CST 2015


This makes sense. Thanks for the quick reply. 

Loïc

> On Dec 6, 2015, at 3:29 AM, Dmitri Gribenko <gribozavr at gmail.com> wrote:
> 
>> On Sat, Dec 5, 2015 at 6:27 PM, Loïc Lecrenier <loiclecrenier at icloud.com> wrote:
>> Great :)
>> 
>> Also, this hasn't been explicitly discussed yet. But do you all agree about adding "real" typealias declarations (with the typealias keyword) inside protocols?
> 
> Concrete typealieases are not requirements, so they shouldn't be
> defined inside of a protocol.  Instead, they should be defined in the
> protocol extension.  In fact, this has been a plan of record for some
> time, but it wasn't implemented.
> 
> extension SequenceType {
>  typealias Element = Generator.Element
> }
> 
> Dmitri
> 
> -- 
> main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if
> (j){printf("%d\n",i);}}} /*Dmitri Gribenko <gribozavr at gmail.com>*/


More information about the swift-evolution mailing list