[Issue 18115] [REG2.078-b1] case where && is not shortcut anymore in CTFE

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 2 21:32:44 UTC 2018


https://issues.dlang.org/show_bug.cgi?id=18115

--- Comment #14 from Rainer Schuetze <r.sagitario at gmx.de> ---
The problem here is not the short-circuiting of semantic analysis, but the
const-folding now done on the second operand of "&&" that predicts a runtime
error if the code is actually executed.

Maybe it's ok to consider const-folding part of the semantic analysis (and the
code in the bug report never should have compiled). Otherwise we could try to
detect dead code and mute const-folding errors in it. But that's a can of worms
that's probably better left closed.

Or is it part of the language definition that you must not compile code
"arr[-1]"?

--


More information about the Digitalmars-d-bugs mailing list