In fact the case labels inherit the type of the variable passed in the switch
This I did not know, and it surprises me a little. Ok, so it's something specific for the switch in combination with enum? I cannot think of another example in which the switch would inherit some type information since the other possible arguments are the 'integer and smaller' primitive types. And I cannot think of another statement where a block of code inherits type information of the variable passed in. Are there any?