:C
@amiloradovsky@functional.cafe guess you meant to omit the default case, cause I'm getting different output and no warnings.
Enumeration in general are not supposed to be type safe, their whole point is to be interchangeable and interoperable with integers, you are supposed to use them to index arrays or do arithmetic or bit twiddling. You can do something like this instead:
http://ix.io/2Il9/c
It's not perfect, but makes it harder to call the function with wrong parameters. They can't do it inattentively anymore, they have to study this mess, understand it, and then intentionally break the clear conventions, ignoring the crashing debug build.