Help with using new Haxe keyword final for constants

Using final seemed to be a better way of declaring/using constants instead of static inline var since final declarations are inherited by subclasses while static inline var declarations are not. However I’ve run into problems when using variables declared as final in switch statements.

If used as a pattern var:

  1. if it begins with an upper-case letter I get “Pattern variables must be lower-case” even though static inline vars that begin with an upper-case letter, it’s no problem.
  2. the first case is matches everything and the other cases are ignored and generate “Warning : This case is unused”

Can someone explain this?

You better ask haxe.org community.