http://d.puremagic.com/issues/show_bug.cgi?id=4517

           Summary: final switch over with base type allows missing values
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bra...@puremagic.com


--- Comment #0 from Brad Roberts <bra...@puremagic.com> 2010-07-27 00:37:46 PDT 
---
module finalswitch;

enum foo : ushort
{
    A = 1,
    B = 3
}

void bar(foo f)
{
    final switch(f)
    {
        case foo.A:
            break;
    }
}

This compiles without error:
$ dmd -c finalswitch.d 
$

Dropping the ': ushort' part and it correctly identifies the missing case:
$ dmd -c finalswitch.d 
finalswitch.d(11): Error: enum member B not represented in final switch

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

Reply via email to