Casting An Enum Case¶
TIL that enumeration cases cannot be cast. They can’t be to a boolean, because they are an object.
They can’t be cast to their scalar value (int or string), even though it looks reasonable to do.
Of course, they can be cast to array (they are simply put inside an array), or to an object (nothing happens).
See Also¶
Cannot Cast Enum [Try me]