[Issue 18115] [REG2.078-b1] case where && is not shortcut anymore in CTFE
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Dec 28 08:37:57 UTC 2017
https://issues.dlang.org/show_bug.cgi?id=18115
--- Comment #8 from Basile B. <b2.temp at gmx.com> ---
(In reply to Rainer Schuetze from comment #7)
> > 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.
Sorry, did you miss my previous answer ? Use the code from the first message.
The regression is obvious.
--
More information about the Digitalmars-d-bugs
mailing list