Bug 9116 – Redundant field postblit call on initializing
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-12-06T00:44:00Z
Last change time
2012-12-06T20:22:07Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2012-12-06T00:44:54Z
This code doesn't work es expected.
void main()
{
static struct X {
int v;
this(this) { ++v; }
}
static struct Y {
X x;
}
X x = X(1);
assert(x.v == 1);
Y y = Y(X(1));
printf("y.x.v = %d\n", y.x.v); // print 2, but should 1
assert(y.x.v == 1); // fails
}