Thread overview
[Issue 11088] New: Diagnostics for enum member overflows should improve
Sep 21, 2013
Andrej Mitrovic
Sep 21, 2013
Andrej Mitrovic
Sep 21, 2013
Walter Bright
Sep 22, 2013
Walter Bright
September 21, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11088

           Summary: Diagnostics for enum member overflows should improve
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: diagnostic, pull
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: andrej.mitrovich@gmail.com
        ReportedBy: andrej.mitrovich@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-09-21 12:18:48 PDT ---
-----
enum E {
    A = int.max,
    B
}
-----

test.d(3): Error: enum member test.E.B overflow of enum value cast(E)2147483647

It should be:

test.d(3): Error: enum member test.E.B initialization with (E.A + 1) causes
overflow for type 'int'

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 21, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11088



--- Comment #1 from Andrej Mitrovic <andrej.mitrovich@gmail.com> 2013-09-21 12:23:49 PDT ---
https://github.com/D-Programming-Language/dmd/pull/2581

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 21, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11088


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com
           Severity|normal                      |enhancement


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 22, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11088



--- Comment #2 from github-bugzilla@puremagic.com 2013-09-21 17:09:39 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/28dc52f3f1eeec025d18ae49d1ba4105da4dfbd2 Fixes Issue 11088 - Print better diagnostics for enum member overflow errors.

https://github.com/D-Programming-Language/dmd/commit/a6075687eb9da2f7a5104d2663c25a65d96f08ed Merge pull request #2581 from AndrejMitrovic/Fix110088

Issue 11088 - Print better diagnostics for enum member overflow errors.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 22, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=11088


Walter Bright <bugzilla@digitalmars.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: -------