Why do I get an Enum constant reference cannot be qualified in a case label?
- by maleki
Why does the following code fail to compile while changing the case statement to
case ENUM1: doSomeStuff();
works?
public enum EnumType
{
ENUM1, ENUM2, ENUM3;
void doSomeStuff()
{
switch(this)
{
case EnumType.ENUM1: doSomeStuff();
}
}
}