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

          Issue ID: 19341
           Summary: Strange foreach, tupleof, const ref interaction
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: accepts-invalid
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nob...@puremagic.com
          Reporter: briancsch...@gmail.com

struct S
{
    double a = 0;
    double b = 0;
    double c = 0;
}

void main()
{
    S s;
    foreach (const ref mVal; s.tupleof)
    {
        mVal = 1 / mVal; // mVal is const and this should not work.
    }
}

--

Reply via email to