[Issue 12689] New: [CTFE] assigning via pointer from 'in' expression doesn't work

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu May 1 12:23:01 PDT 2014


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

          Issue ID: 12689
           Summary: [CTFE] assigning via pointer from 'in' expression
                    doesn't work
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Keywords: CTFE, wrong-code
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: nilsbossung at googlemail.com

Works with 2.057 and earlier.

---
cat > test.d << code
static int g()
{
    int[int] aa;
    aa[1] = 13;
    assert(*(1 in aa) == 13); /* passes */
    *(1 in aa) = 42; /* no effect in CTFE */
    return aa[1];
}
void main()
{
    assert(g() == 42);
    enum e = g();
    assert(e == 42); /* fails */
    assert(e != 13); /* fails */
}
code
rdmd test.d
---
core.exception.AssertError at test(13): Assertion failure
---

--


More information about the Digitalmars-d-bugs mailing list