The switch statement is somewhat tedious due to the need for "break" on every case. It's needed for C compatibility, but it would be nice to be able to request that cases break automatically. Hence, something like:
switch(z) auto break
{
case 0: writeln("empty!");
case 1, 2: writeln("small!");
case 3, 4, 5: writeln("medium!");
default: writeln("large!");
}
In case empty cases are adjacent, such as "case 1: case 2:", D should logically make "case 1" a no-op, but warning should be issued because this is the C# syntax for "case 1, 2:". e.g.:
warning: "case 1" does nothing. To clarify your intention, use "break" or "case 1, 2".
Comment #1 by andrei — 2016-10-15T13:03:24Z
Thanks. You may want to formulate this as a DIP and see if it gets traction.