[Issue 14089] New: [REG2.064] Assigning to AA has no value when overriding opAssign

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sat Jan 31 07:43:11 PST 2015


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

          Issue ID: 14089
           Summary: [REG2.064] Assigning to AA has no value when
                    overriding opAssign
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: sinkuupump at gmail.com

Introduced in: https://github.com/D-Programming-Language/dmd/pull/2539

void test()
{
    Test[int] aa;
    Test b = aa[1] = Test();
}

struct Test
{
    Test opAssign(Test val) // ok if remove this
    {
        return this;
    }
}

$ dmd test.d
test.d(4): Error: expression 1 in aa ? aa[1].opAssign(Test()) :
cast(void)(aa[1] = Test()) is void and has no value

--


More information about the Digitalmars-d-bugs mailing list