[Issue 6216] New: Built-in opAssign implicitly defined should call field's opAssign

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jun 26 10:52:19 PDT 2011


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

           Summary: Built-in opAssign implicitly defined should call
                    field's opAssign
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2011-06-26 10:47:27 PDT ---
Following should compile.
----
struct X
{
    int n;
    const void opAssign(const X rhs) {}
}
struct S
{
    int n;
    const(X) x;
}
void main()
{
    S s;
    s = s;
}
----
test.d(14): Error: variable test.main.s cannot modify struct with immutable
members
----

S has implicitly defined opAssign, but it does not call field x's opAssign.

-- 
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