[swift-evolution] [swift-evolution-announce] [Review] Replace `typealias` keyword with `associatedtype` for associated type declarations

Alex Migicovsky migi at apple.com
Sun Jan 3 12:10:20 CST 2016

> * What is your evaluation of the proposal?

I think the proposal is great. The only thing I’d prefer is to use `associated` over `associatedtype`.

`associated` has always felt better to me over `associatedtype`. It was mentioned in one of the original proposals as the keyword that was initially most well received as well—I think this is because it just feels right, which is a good indicator even though it doesn’t seem scientific :-)

One downside mentioned is that `associated` is more vague than `associatedtype`, but there’s a reason why we don’t have `protocoltype`, `classtype`, etc as keywords over `protocol` and `class`. I think the convention of having associated type names start with an uppercase letter makes it clear that what follows `associated` is a type (or will be a concrete type).

> * Is the problem being addressed significant enough to warrant a change to Swift?

Yes, I’ve seen many developers be confused by the difference between defining a typealias inside a protocol declaration vs outside.

> * Does this proposal fit well with the feel and direction of Swift?


> * How much effort did you put into your review? A glance, a quick reading, or an in-depth study?

I’ve been paying attention to the thread and have thought about why I like `associated` over `associatedtype` since the start of the thread.

- Alex

More information about the swift-evolution mailing list