www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 16173] New: Implicit fall through is silently allowed

https://issues.dlang.org/show_bug.cgi?id=16173

          Issue ID: 16173
           Summary: Implicit fall through is silently allowed
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: 4burgos gmail.com

```
import std.stdio;
import std.conv;
void main(string[] argv)
{
    int x = to!(int)(argv[1]);
    switch (x) {
        case 1:
            writeln("From 1");
        case 2:
            writeln("From 2");
            x = 3;
            break;
        case 3:
            x = 4;
        default:
            break;
    }

    writeln("x = ", x);
}
```
```
$ rdmd test.d 1
From 1
From 2
x = 3 ``` --
Jun 14 2016