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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Dec 27 20:01:08 UTC 2017


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

--- Comment #4 from Rainer Schuetze <r.sagitario at gmx.de> ---
if you change the test to

int test()
{
    if (test.stringof.length < 7)
        return 0;
    return test.stringof[$-7..$] == "1234567";
}

enum a = test();


it fails for older versions, too. That's caused by the semantic analysis
already trying to optimize expressions. I guess it must not do this in case of
errors but defer it to the runtime error.

--


More information about the Digitalmars-d-bugs mailing list