On Friday, 4 December 2015 at 03:38:23 UTC, Steven Schveighoffer wrote:

Yes, I know that trick. In swift, everywhere you are using/expecting a Foo, it allows the shortcut.

It's very nice when you are doing things that require a lot of enum function parameters (UI has a lot of this).

-Steve

Do you mean something like:

enum Foo { bar, baz }
void fun(Foo foo) { }

fun(baz);

I don't really mind having to use switch/with but I've found myself wishing for the above on occasion.

Reply via email to