https://issues.dlang.org/show_bug.cgi?id=13010
Brad Roberts <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #5 from Brad Roberts <[email protected]> --- --- Comment originally from [email protected] --- (In reply to Kenji Hara from comment #4) > By advancing the thought, compiler will be able to generate "statement is > not reachable" warning in else branch of the code. > > void test(ubyte n) > { > immutable int i = n; > if (i >= 0) // const-folding with VRP will optimize the condition to > true. > { ... } > else > { ... } // so the else branch could be determined to "not reachable" > } Looks nice I guess this will generate few nice warnings in Phobos and in D code around. --
