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

Loïc Lecrenier loiclecrenier at icloud.com
Wed Jan 6 14:56:28 CST 2016


> 
> What about the all lower case “associatedtype”? The underscore alternative of “associated_type” breaks existing language precedent. The camel case version (“associatedType”) does have language precedent, and I wonder if it wouldn’t be a better choice:
> 
>    dynamicType
>    didSet
>    willSet
> 
> However, there’s also precedent for making paired words all lowercase in keywords:
> 
>    typealias
>    fallthrough
>    deinit           ←(debatable: could be considered single word or hyphenated)
> 
> Perhaps keyword capitalization conventions deserve some attention across the board.

I thought the rules were:
- property/method: lowerCamelCase
- language keyword: lowercase

I consider 
- dynamicType as a property
- didSet, willSet, deinit as methods.
- typealias, fallthrough as language keywords

And “associatedtype” would be a language keyword too, so it is lowercase 😊

Loïc


More information about the swift-evolution mailing list