Summary: Better error messages for a switch on doubles
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: DMD

--- Comment #0 from 2012-10-12 14:38:24 PDT ---
>From the thread:

void main() {
     double value = 1;
     switch (value) {
       case 1:
         // do something

DMD 2.061alpha gives:

temp2.d(3): Error: 'value' is not of integral type, it is a double
temp2.d(4): Error: case must be a string or an integral constant, not 1

The error messages are not so good:
- The first error message misses the possibility of a switch on strings.
- The second error message is just wrong, because 1 is on default an integral

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to