digitalmars.D.learn - Postblit not called in one case
- bearophile (20/20) Jul 05 2011 With DMD 2.053 the second assert of this program fires, is this a DMD bu...
- Daniel Murphy (3/24) Jul 06 2011 Looks like a bug. Please file.
- bearophile (4/5) Jul 06 2011 http://d.puremagic.com/issues/show_bug.cgi?id=6257
With DMD 2.053 the second assert of this program fires, is this a DMD bug or
it's me that's missing something?
struct Foo {
int[] data;
this(int n) {
data.length = n;
}
this(this) {
data = data.dup;
}
}
void main() {
Foo f1, f2;
f1 = Foo(1);
f2 = f1;
assert(f1.data.ptr != f2.data.ptr); // OK
f1 = f2 = Foo(1);
assert(f1.data.ptr != f2.data.ptr); // asserts
}
Bye and thank you,
bearophile
Jul 05 2011
Looks like a bug. Please file.
"bearophile" <bearophileHUGS lycos.com> wrote in message
news:iv0eki$1d8e$1 digitalmars.com...
With DMD 2.053 the second assert of this program fires, is this a DMD bug
or it's me that's missing something?
struct Foo {
int[] data;
this(int n) {
data.length = n;
}
this(this) {
data = data.dup;
}
}
void main() {
Foo f1, f2;
f1 = Foo(1);
f2 = f1;
assert(f1.data.ptr != f2.data.ptr); // OK
f1 = f2 = Foo(1);
assert(f1.data.ptr != f2.data.ptr); // asserts
}
Bye and thank you,
bearophile
Jul 06 2011
Daniel Murphy:Looks like a bug. Please file.http://d.puremagic.com/issues/show_bug.cgi?id=6257 Bye, bearophile
Jul 06 2011








bearophile <bearophileHUGS lycos.com>