http://d.puremagic.com/issues/show_bug.cgi?id=3475
Summary: .dup does not call this(this) for elements
Product: D
Version: unspecified
Platform: Other
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Andrei Alexandrescu <[email protected]> 2009-11-05
10:50:17 PST ---
struct Widget {
private int[] array;
this(uint length) {
array = new int[length];
}
this(this) {
array = array.dup;
}
}
void main() {
auto a = new Widget[1];
a[0] = Widget(10);
auto b = a.dup;
assert(b[0].array !is a[0].array);
}
The code fails. It should pass.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------