On 16/07/17 16:34, DaWorm wrote:
If the programmer builds a case statement on an enum, that includes all of the possible enum values, and also includes an else clause, to me it seems the programmer is implicitly telling the compiler that there is the possibility of illegal values stored in the enum.

Writing unreachable code never has constituted implicitly telling a compiler anything in any programming language. At best, you will get a warning from the compiler that the code is unreachable.

You don't want a compiler to start second-guessing what you might have meant when you wrote something. Everything must be 100% unambiguous.


Jonas
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to