[Issue 6176] [TDPL] Cannot use string variables in case expressions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Jul 8 01:18:19 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6176



--- Comment #8 from Jonathan M Davis <jmdavisProg at gmx.com> 2011-07-08 01:13:14 PDT ---
Well, it works with variables which are of type int. TDPL claims that it works
with variables, and switch statements work with integral types and strings. So,
per TDPL, switch statements should work with string variables.

Now, personally, I'm very surprised that _any_ type of variable would be
permitted as the value of a case statement under any circumstances, and it
wouldn't hurt my feelings one whit if it were removed from the language
completely. I see no value in such a feature. However, TDPL is pretty clear
about allowing variables, so it certainly didn't get in there by accident (and
using integer variables _does_ currently work).

So, it's fine with me if this is declared as an errata for TDPL, but I don't
think that it's a case of TDPL being unclear.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list