Casting into an enum

In reply to raysalemi:

In your code you cast to an enum variable. It might be the case that I am partly wrong and that they allow casting to class variables and enums. This situation is explicitly listed in the 2012 LRM in section 6.24.2 $cast dynamic casting, on page 99.