[Issue 18503] New: Confusing error message for erroneous postblit
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Fri Feb 23 12:21:32 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18503
Issue ID: 18503
Summary: Confusing error message for erroneous postblit
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: enhancement
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: razvan.nitu1305 at gmail.com
This code:
class C
{
this(this) {}
}
issues:
test.d(3): Error: postblit can only be a member of struct/union, not class C
Ok. Let's define a union with a postblit:
union D
{
this(this) {}
}
output:
test.d(8): Error: function `test.D.__postblit` destructors, postblits and
invariants are not allowed in union D
That's odd, you just instructed me that a union can have a postblit! Shame on
you compiler!
Spec: "Unions may not have postblits, destructors, or invariants." [1]
[1] https://dlang.org/spec/struct.html
--
More information about the Digitalmars-d-bugs
mailing list