$ /tmp/dmd2/linux/bin64/dmd -version=BUG foo.d foo.d(16): Error: struct foo.Foo is not copyable because it is annotated with @disable $ cat foo.d struct Foo { version(BUG) { @disable this(this); } this(ref inout(Foo) other) { import std.stdio; writeln("Copy Construtor"); } } void main() { Foo d; Foo e = d; // copy -- no issue Foo[] foos; // foos.length = foos.length + 1; // foos[$-1] = d; // opAssign into array element -- no issue foos ~= d; // <<<<<< does not compile }
Getting the same issue if I replace Foo[] with std.container.Array!Foo.
This has been fixed by https://github.com/dlang/dmd/pull/11945