D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3257 - Spec is unclear describing string switch case labels
Summary: Spec is unclear describing string switch case labels
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dlang.org (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL: http://www.digitalmars.com/d/2.0/stat...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-18 06:28 UTC by Jerry Quinn
Modified: 2015-06-09 01:28 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Jerry Quinn 2009-08-18 06:28:13 UTC
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.
Comment 1 Jarrett Billingsley 2009-08-18 07:40:23 UTC
Wow.  D used to have "ascii" and "unicode" strings before the current scheme, which means that description is just several years out-of-date ;)
Comment 2 Walter Bright 2009-09-03 13:45:38 UTC
Fixed dmd 2.032