← Back to index
|
Original Bugzilla link
Bug 20942 – [DMD HEAD] Unable to append a postblit disabled struct to a dynamic array
Status
RESOLVED
Resolution
FIXED
Severity
blocker
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2020-06-17T14:31:19Z
Last change time
2022-03-25T11:13:28Z
Assigned to
No Owner
Creator
Puneet Goel
Comments
Comment #0
by puneet — 2020-06-17T14:31:19Z
$ /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 }
Comment #1
by puneet — 2020-06-17T18:02:45Z
Getting the same issue if I replace Foo[] with std.container.Array!Foo.
Comment #2
by razvan.nitu1305 — 2022-03-25T11:13:28Z
This has been fixed by
https://github.com/dlang/dmd/pull/11945