www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7320] New: final switch on enum with backing type not statically checked

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

           Summary: final switch on enum with backing type not statically
                    checked
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: xtzgzorex gmail.com



09:13:51 PST ---
This builds:

enum Test : ubyte
{
    foo,
    bar,
    baz,
}

void main()
{
    auto i = Test.bar;

    final switch (i)
    {
        case Test.foo:
            break;
    }
}

Remove the : ubyte and it doesn't.

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




09:17:28 PST ---
Andrej Mitrovic notes that if : int is specified as the backing type, the
sample fails to build as expected. So, it seems as if any non-default backing
type causes the bug.

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


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bearophile_hugs eml.cc



See also issue 5713

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


Denis <verylonglogin.reg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |verylonglogin.reg gmail.com
         Resolution|                            |DUPLICATE



---
*** This issue has been marked as a duplicate of issue 4517 ***

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