[Issue 5713] Broken final switch on ints

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 7 10:16:10 PDT 2011


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



--- Comment #5 from bearophile_hugs at eml.cc 2011-09-07 10:15:54 PDT ---
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;
    }
}

-- 
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