On 29/06/16 05:11, Hiemlick Hiemlicker wrote:
Suppose one has void test(myEnum e)

enum myEnum
{
A,B,C
}

It would be very cool if we could do

test(A) instead of test(myEnum.A).

by context, the compiler can look first in the scope for something named
A then look in the enum itself and prepend myEnum internally.

Swift has this feature (the enum member needs to be prefix with a dot). This has been brought up before and Walter doesn't like it. It will complicate the language, especially function overloading:

enum Foo { A }
enum Bar { A }

void foo(Foo);
void foo(Bar);

foo(A); // ambiguity

--
/Jacob Carlborg

Reply via email to