It's also logical that using ranges with strings is dangerous and should not be done.
Why then does FPC syntax allow it?
Bart, 'A', 'a'..'z' is
AnsiChar syntax - not
string syntax - and always allowed because AnsiChars are
enumerable.
Howard, FPC has the option to use strings for
case (I was against it but it was accepted and works somewhat).
Maybe another case that UTF8 hick-ups? I'll have to test this some more...Because UTF8 char is
NOT enumerable....It needs to be an enumerable type.
So
explicitly AnsiChar, otherwise the stupid "string" case statements kick in.
But that does not explain the behavior in pure FPC... I agree with that. It would explain a Lazarus project, though....
I noticed the switch was already made with string syntax, which I am not a fan of and was in my opinion not thought through as a "feature".
See the mess up here..... And Delphi doesn't support it a all...
"Hello" made the compiler look at the string case, hence the complete case is evaluated as strings.
Suggestion:
hide the documentation for "case string"...