This works, but the more recommended solution when dealing with enums is to explicitly deal with all possible cases. You can then put assert_not_reached () or at least an explicit warning in the default section so any additions to the enum are flagged up.
This works, but the more recommended solution when dealing with enums is to explicitly deal with all possible cases. You can then put
assert_not_reached ()
or at least an explicit warning in the default section so any additions to the enum are flagged up.