www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 7390] New: Problem in generating switch cases with a static foreach

reply d-bugmail puremagic.com writes:
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: nobody puremagic.com
        ReportedBy: bearophile_hugs eml.cc



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: -------
Jan 28 2012
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=7390


dawg dawgfoto.de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |dawg dawgfoto.de
         Resolution|                            |DUPLICATE



This seems to be fixed with Bug 6518.

*** This issue has been marked as a duplicate of issue 6518 ***

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




I am seeing the case fallthrough error still, on Windows. This bug seems not
fixed.

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


bearophile_hugs eml.cc changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|DUPLICATE                   |



To see the wrong error message you need to compile with -w or -wi  (confirmed
on x86-64 linux too by Zor).

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