www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3714] New: Identity assignment operator overload LEGAL for const, shared, etc.

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3714

           Summary: Identity assignment operator overload LEGAL for const,
                    shared, etc.
           Product: D
           Version: 2.036
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: tomeksowi gmail.com



PST ---
I posted this on the D newsgroup some time ago but didn't get any response. So
I'm creating a ticket.


This rightfully doesn't compile:

class A {
    A opAssign(A a);   // Error: function test.A.opAssign identity assignment
operator overload is illegal
}

However, this does:

class A {
    A opAssign(const A a);
}


Also compiles for shared(A) and presumably for any_type_constructor(A). If
there aren't any feasible uses for this, I think it should fail.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 17 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3714


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |FIXED



09:08:34 PST ---
Fixed in 2.061 git-head.

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