www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15909] New: Duplicate case error reports characters as numbers

https://issues.dlang.org/show_bug.cgi?id=15909

          Issue ID: 15909
           Summary: Duplicate case error reports characters as numbers
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: trivial
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: andy.pj.hanson gmail.com

This code:

    void main() {
        switch ('a') {
            case 'a': case 'a':
                break;
        }
    }

Fails with this error:

    app.d(3): Error: duplicate case 97 in switch statement

It would be nicer to use 'a' instead of 97.

--
Apr 09 2016