if alias this is used on a member value (whether simple, or another struct) copying an instantiated struct no longer results in all struct members being copied (only the aliased value is copied). The version is Version D 2.048 (version text copied from changelog) The problem is best illustrated by a minimal example: ----- self contained d sample starts ----- import std.stdio, std.math; void main() { auto p = Test(0.5, 0.5); assert(0.5 == p.a); // ok assert(0.5 == p.b); // ok Test q; //q = Test(0.5, 0.5); // // the above line can substitute // the one below and the same // problem occurs q = p; if (isNaN(q.b)) printf("problem replicated\n"); assert(0.5 == q.a); // ok assert(0.5 == q.b); // this fails } struct Test { double a; double b; alias a this; } ----- end of file -----
Dup of Bug 2943. *** This issue has been marked as a duplicate of issue 2943 ***