> Is this made safe by always having an else/otherwise? If so, could the > compiler at least raise a warning if an enumeration was sparse but there > was no else/otherwise to catch unexpected cases? Interestingly, not in FPC.
This was also always my intuition that the else block is also triggered for invalid enum values (the docs even literally say that, "If none of the case constants match the expression value") - and it *is* true in Delphi. In FPC it is also mostly true, unless you happen to fall into this optimisation. _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel