[swift-evolution] [Discussion] Enum Leading Dot Prefixes
Erica Sadun
erica at ericasadun.com
Sat Feb 13 17:04:07 CST 2016
This was the one place I went back and forth a few times: include it for consistency in referencing enum cases *everywhere* or leave it as is to match static behavior. I can argue it either way.
-- E
> On Feb 13, 2016, at 1:39 PM, Brent Royal-Gordon <brent at architechies.com> wrote:
>
>> 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