Copy constructor for Bar and Frop are silently ignored. When codebase is large with Bar having a significant number of elements, it becomes very confusing why copy constructor of Bar and Frop are getting ignored. Perhaps Foo could as well be imported from a library module. //// import std.stdio; struct Frop { this (ref inout(Frop) frop) { writeln("Frop copy constructor"); } } struct Foo { this(this) { writeln("Foo postblit constructor"); } } struct Bar { Foo foo; Frop frop; this (ref inout(Bar) bar) { writeln("Bar copy constructor"); foo = bar.foo; frop = bar.frop; } } void main() { Bar bar; Bar bar2 = bar; }
*** This issue has been marked as a duplicate of issue 20714 ***