[Issue 5713] Broken final switch on ints

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 24 04:02:05 PST 2012


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


Denis <verylonglogin.reg at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |verylonglogin.reg at gmail.com


--- Comment #7 from Denis <verylonglogin.reg at gmail.com> 2012-01-24 15:01:58 MSK ---
(In reply to comment #5)
> An example from Timon Gehr, this gives no compilation errors, and prints
> nothing:
> 
> 
> import std.stdio;
> enum Mode { nothing, read, write }
> void main() {
>     final switch (Mode.read | Mode.write) {
>         case Mode.nothing: writeln(0); break;
>         case Mode.read:    writeln(1); break;
>         case Mode.write:   writeln(2); break;
>     }
> }

Created issue 7358 inspired by this (inspired but different because this code
can be statically rejected).

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


More information about the Digitalmars-d-bugs mailing list