https://issues.dlang.org/show_bug.cgi?id=20653
Dennis <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #3 from Dennis <[email protected]> --- (In reply to Ketmar Dark from comment #1) > it never worked with static ifs. i was pretty sure that it was By Design, > but i cannot remember if i really read that somewhere in the specs, or > simply made it out. Short circuiting actually works in certain static conditions: ``` static if (false && bogusName) {} static assert(true || bogusName); void foo(T)() if (true ? true : bogusName) {}; alias x = foo!int; ``` This is implemented in staticcond.d, function `evalStaticCondition`: > Semantically analyze and then evaluate a static condition at compile time. > This is special because short circuit operators &&, || and ?: at the top > level are not semantically analyzed if the result of the expression is not > necessary. That function is not used to evaluate enums however. --
