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

           Summary: Problem in generating switch cases with a static
                    foreach
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2012-01-28 07:06:11 PST ---
This seems related to bug 6518
Generating switch cases with a static foreach gives some problems still (DMD
2.058head):



import std.typetuple: TypeTuple;
void main() {
    char c;

    switch (c) { // OK
        case 'z': break;
        case 'x': break;
        case 'y': break;
        default: break;
    }

    alias TypeTuple!('x', 'y') xy;

    switch (c) { // OK
        foreach (X; xy) {
            case X: break;
        }
        default: break;
    }

    switch (c) {
        case 'z': break;
        foreach (X; xy) {
            case X: break;
        }
        default: break; // Error: switch case fallthrough
    }
}

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

Reply via email to