Bug 3714 – Identity assignment operator overload LEGAL for const, shared, etc.
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2010-01-17T08:18:00Z
Last change time
2015-06-09T01:27:04Z
Assigned to
nobody
Creator
tomeksowi
Comments
Comment #0 by tomeksowi — 2010-01-17T08:18:24Z
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.
Comment #1 by andrej.mitrovich — 2012-12-21T09:08:34Z