digitalmars.D.bugs - [Issue 8807] New: Better error messages for a switch on doubles
- d-bugmail puremagic.com (35/35) Oct 12 2012 http://d.puremagic.com/issues/show_bug.cgi?id=8807
- d-bugmail puremagic.com (13/17) Jan 10 2013 http://d.puremagic.com/issues/show_bug.cgi?id=8807
- d-bugmail puremagic.com (13/13) Jan 19 2013 http://d.puremagic.com/issues/show_bug.cgi?id=8807
- d-bugmail puremagic.com (14/15) Jan 20 2013 http://d.puremagic.com/issues/show_bug.cgi?id=8807
http://d.puremagic.com/issues/show_bug.cgi?id=8807 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 AssignedTo: nobody puremagic.com ReportedBy: bearophile_hugs eml.cc From the thread: http://forum.dlang.org/thread/osnevnwnshreoaudleep forum.dlang.org void main() { double value = 1; switch (value) { case 1: // do something break; default: } } 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 constant. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 12 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8807 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrej.mitrovich gmail.com 15:50:45 PST ---temp2.d(3): Error: 'value' is not of integral type, it is a doubleThis is solved in pull for Issue 4540.temp2.d(4): Error: case must be a string or an integral constant, not 1 - The second error message is just wrong, because 1 is on default an integral constant.It's not actually wrong, 1 is implicitly converted to type double. Unfortunately it doesn't print 1.0 to make it obvious. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 10 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8807 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |pull Platform|x86 |All AssignedTo|nobody puremagic.com |andrej.mitrovich gmail.com OS/Version|Windows |All 19:59:16 PST --- https://github.com/D-Programming-Language/dmd/pull/1514 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 19 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8807 Andrej Mitrovic <andrej.mitrovich gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |WORKSFORME 10:00:49 PST ---https://github.com/D-Programming-Language/dmd/pull/1514as '1' because it's a more general problem unrelated to the switch statement. http://d.puremagic.com/issues/show_bug.cgi?id=9357 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Jan 20 2013