I have a switch statement in Java, on an Enum which let us call IMyInterface.MyEnum
Each of my case statements has the form: IMyInterface.MyEnum.MyValue, (though I could drop the IMyInterface if I imported).
However, the compiler (Java 6) throws an error: "The qualified case label IMyInterface.MyEnum.MyValue must be replaced with the unqalified enum constant MyValue".
I can obviously do that, but for the life of me I don't understand what is the purpose of this error. Clearly, if the compiler can deal with the actual value, it should be able to deal with the fully qualified name just as it would for constants. In fact, I would have assumed that the compiler turns the constant into the fully qualified name.
So, Java gurus, what's the rationale behind this? Thank you!