[swift-evolution] Dotless case names in switch cases

Joe Groff jgroff at apple.com
Fri Jan 15 18:42:09 CST 2016


> On Jan 15, 2016, at 2:44 PM, Jens Persson via swift-evolution <swift-evolution at swift.org> wrote:
> 
> enum SomeEnum {
>     case Foo
>     case Bar
>     func demoDotAndNoDot() {
>         switch self {
>         case .Foo: print("This has the usual dot before the case name.")
>         case Bar: print("This has no dot, which is ok, at least in this particular context.")
>         }
>     }
> }
> 
> I'm just throwing this out in case someone should feel like writing a formal proposal to remove the dotless form.
> 
> I'd be ok with removing it since it only works in some specific contexts. 

This works by normal instance member lookup. Why do you think it should be removed?

-Joe



More information about the swift-evolution mailing list