https://issues.dlang.org/show_bug.cgi?id=18115
--- Comment #7 from Rainer Schuetze <[email protected]> --- > Rainer, not sure what you're saying. > Is it invalid code in the test case, or a compiler problem? I'm not 100% sure. At runtime the code will always produce a RangeError, but the check before it causes it to never be executed. Should it still be a compile error? Allowing the condition could make writing generic code simpler, but might also trigger the "unreachable code" warning later. To change it, dmd.constfold must not produce errors (unconditionally), but keep the expressions that *might* cause an error at runtime or CTFE. Array indexing and divide by zero are probably affected, too. --
