https://issues.dlang.org/show_bug.cgi?id=8950
kinke <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #3 from kinke <[email protected]> --- Copy ctors are currently (wrongly) ignored when copying static arrays: https://issues.dlang.org/show_bug.cgi?id=20365 This issue here is pretty bad and inconsistent - the postblit is called correctly for mutable copies and scalar non-mutable copies, only non-mutable static array copies ignore the postblit: void main() { static struct S { int x = 42; this(this) { x += 10; } } { S source; S mutableCopy = source; assert(mutableCopy.x == 52); const S constCopy = source; assert(constCopy.x == 52); } { S[1] source; auto mutableCopy = source; assert(mutableCopy[0].x == 52); const constCopy = source; assert(constCopy[0].x == 52); // fails immutable immutableCopy = source; assert(immutableCopy[0].x == 52); // fails } } --
