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

David Waite david at alkaline-solutions.com
Sun Jan 3 10:27:25 CST 2016


> 	* What is your evaluation of the proposal?


+1, with caveats

From a wording perspective, the “Proposed Approach” and “Impact on Existing Code” sections talk about removing typealias, while the intention is almost certainly to remove typealias usage within protocols only. My review assumes the latter.  

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

I think it is based on Swift today, in particular for the reasons given in the proposal (that it looks like, but is not possible, to use typealias to declare a type alias inside a protocol)

I personally find it cumbersome that Swift does not allow protocols with associated types to be used other than under generic constraints - I would prefer generic protocols. If generic protocols were on the horizon, then I do not know whether declaring associated types inline is even a necessary feature.

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

Yes, although I still feel the keyword is long.

> 	* If you have you used other languages or libraries with a similar feature, how do you feel that this proposal compares to those?

Since Swift is the only language I have used with associated types, I can only compare to Swift 1 and 2. I feel this will make the protocols themselves easier to understand

> 	* How much effort did you put into your review? A glance, a quick reading, or an in-depth study?
> 
I followed the mailing list for the most part, read the proposal, and imagined adding it to my own protocols.

-DW


More information about the swift-evolution mailing list