http://d.puremagic.com/issues/show_bug.cgi?id=7075
Summary: Struct class comparison should check opAssign for
class
Product: D
Version: D2
Platform: Other
OS/Version: Other
Status: NEW
Severity: normal
Priority: P2
Component: websites
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Jesse Phillips <[email protected]> 2011-12-06
20:32:40 PST ---
The table states that classes do not overload the assignment operator. However
this code compiles:
class A {
int a;
string b;
float c;
void opAssign(B b) {
a = b.a;
}
}
class B {
int a;
}
void main()
{
auto a = new A();
a.a = 5;
auto b = new B();
b.a = 10;
a = b;
assert(a.a == 10);
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------