[swift-evolution] [Discussion] Enum Leading Dot Prefixes

Brent Royal-Gordon brent at architechies.com
Sat Feb 13 14:39:55 CST 2016


> The current spec has the following line:
> 
>> static func staticFunc2() { let foo = .Tails } // requires leading dot
> The leading dot requirement does not exist today for references to static properties and functions from a static function.
> 
> Is your proposal to:
> - require a dot in front of static properties/functions in this case as well for consistency across all static things
> - require a dot only in front of the case statements, to promote consistency only for use of cases within an enum
> - or, do you wish to change your mind about this particular case?

Yeah, I don't like this either. You require leading dots in instance members to promote simple, clear rules…then require them in static members too, making a muddy, complicated rule there. Just treat enum cases like any other static member.

-- 
Brent Royal-Gordon
Architechies



More information about the swift-evolution mailing list