[Issue 3376] New: [tdpl] Multiple ranged case labels don't work

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 8 12:00:24 PDT 2009


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

           Summary: [tdpl] Multiple ranged case labels don't work
           Product: D
           Version: unspecified
          Platform: Other
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: andrei at metalanguage.com


--- Comment #0 from Andrei Alexandrescu <andrei at metalanguage.com> 2009-10-08 12:00:23 PDT ---
void classify(char c) {
   write("You passed ");
   switch (c) {
      case '#': 
         writeln("a hash sign."); 
         break;
      case '0': .. case '9': 
         writeln("a digit."); 
         break;
      case 'A': .. case 'Z': case 'a' .. case 'z': 
         writeln("an ASCII character."); 
         break;
      case '.', ',', ':', ';', '!', '?': 
         writeln("a punctuation mark."); 
         break;
      default:
         writeln("quite a character!");
         break;
   }
}

The code fails to compile. If I change the line:

      case 'A': .. case 'Z': case 'a' .. case 'z': 

to:

      case 'A': .. case 'Z':

then it compiles.

-- 
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