[Issue 9634] [CTFE] std.regex.ctRegex chokes on (?:a+)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 17 15:12:51 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9634



--- Comment #5 from Nils <nilsbossung at googlemail.com> 2013-04-17 15:12:50 PDT ---
Reduced the code from comment #2 further:

struct Bytecode
{
    int raw;
}

Bytecode[] getIr()
{
    Bytecode[] ir;

    ir ~= Bytecode(42);
    ir ~= ir[0 .. 1]; // add .dup and CTFE gets it
    assert(&ir[0] != &ir[1]); // fails in CTFE

    ir[0].raw = 13; // overwrites both ir[0] and ir[1]
    assert(ir[0].raw == 13);
    assert(ir[1].raw == 42); // fails in CTFE

    return ir;
}

void main()
{
    enum expected = [Bytecode(13), Bytecode(42)];
    assert(getIr() == expected); // passes
    static assert(getIr() == expected); // fails
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list