[swift-evolution] [SE-0011] Re-considering the replacement keyword for "typealias"

Andrey Tarantsov andrey at tarantsov.com
Tue Dec 22 20:59:56 CST 2015


> I don’t see how this:
> 
> protocol P {
>   type/*alias*/ A
> }
> 
> struct X : P {
>   struct A {}
> }
> 
> is fundamentally any different from:
> 
> protocol P {
>   func f()
> }
> 
> struct X : P {
>   func f() {}
> }
> 
> What am I missing?

I'd say it's the fact that adding an associated type turns a protocol into a frankenprotocol, and we don't want that to be cast upon innocent souls without a proper curse word (like "associatedtype").

Also, maybe some day we'll have normal type requirements — something that has to be defined in a protocol, but does not turn it into a frankenprotocol than nobody can use anymore. That would be an appropriate use of the normal-looking keywords.

A.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-evolution/attachments/20151223/913137f7/attachment.html>


More information about the swift-evolution mailing list