http://d.puremagic.com/issues/show_bug.cgi?id=8433
Summary: Compiler could warn on duplicate static if checks which can't branch Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: enhancement Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: andrej.mitrov...@gmail.com --- Comment #0 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2012-07-25 06:38:22 PDT --- void main() { enum int x = 1; static if (x == 1) { writeln("1"); } else static if (x == 1) { writeln("2"); } } Only the first write statement will be compiled in. I think the compiler could help in these cases and produce a warning. There could be more complicated cases like: static if (x != 1) { } else static if (x == 2) { } Here again the second branch is never compiled. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------