[Issue 20942] New: [DMD HEAD] Unable to append a postblit disabled struct to a dynamic array
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Jun 17 14:31:19 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=20942
Issue ID: 20942
Summary: [DMD HEAD] Unable to append a postblit disabled struct
to a dynamic array
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: blocker
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: puneet at coverify.org
$ /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
}
--
More information about the Digitalmars-d-bugs
mailing list