www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3257] New: Spec is unclear describing string switch case labels

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3257

           Summary: Spec is unclear describing string switch case labels
           Product: D
           Version: 2.031
          Platform: All
               URL: http://www.digitalmars.com/d/2.0/statement.html#CaseSt
                    atement
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: www.digitalmars.com
        AssignedTo: nobody puremagic.com
        ReportedBy: jlquinn optonline.net


In the docs, it describes the allowable string case labels as follows:

  Both ascii and wchar strings are allowed. 

Is this true?  Or are char utf-8 and dchar strings also allowed?  If not, it
seems a strange restriction.

It is also unclear if compile-time-evaluable expressions are allowed for string
case labels.  The general text on switches makes it seem so, but the above text
moddies the waters a little, I think.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 18 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3257


Jarrett Billingsley <jarrett.billingsley gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jarrett.billingsley gmail.c
                   |                            |om




--- Comment #1 from Jarrett Billingsley <jarrett.billingsley gmail.com> 
2009-08-18 07:40:23 PDT ---
Wow.  D used to have "ascii" and "unicode" strings before the current scheme,
which means that description is just several years out-of-date ;)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 18 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3257


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla digitalmars.com
         Resolution|                            |FIXED




--- Comment #2 from Walter Bright <bugzilla digitalmars.com>  2009-09-03
13:45:38 PDT ---
Fixed dmd 2.032

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