[Issue 16173] Implicit fall through is silently allowed
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Tue Jun 14 09:05:15 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16173
--- Comment #1 from Nemanja Boric <4burgos at gmail.com> ---
(In reply to Nemanja Boric from comment #0)
> ```
> 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
> ```
DMD v2.071.0
--
More information about the Digitalmars-d-bugs
mailing list