www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4540] New: Better error message for wrong switch type

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

           Summary: Better error message for wrong switch type
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



This is a wrong D2 program:

void main() {
    float x;
    switch (x) {
        default:
    }
}


dmd 2.047 prints:
test.d(3): Error: 'x' is not of integral type, it is a float


But in D strings too are allowed in switch, so a better error message can be:
test.d(3): Error: 'x' is not of integral type or string, it is a float

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jul 31 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4540


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull
                 CC|                            |andrej.mitrovich gmail.com
         AssignedTo|nobody puremagic.com        |andrej.mitrovich gmail.com



18:23:30 PST ---
https://github.com/D-Programming-Language/dmd/pull/1417

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 27 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4540




Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/8ab6ab22b7e7d160732d72c71e9953e750f6b1be
Fixes Issue 4540 - Better diagnostic for wrong switch type.

https://github.com/D-Programming-Language/dmd/commit/98e20bc85dbfd63e11a607c813fc6ae73554b631


Issue 4540 - Better diagnostic for wrong switch type.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 10 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4540


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 11 2013