[Issue 21349] copy and postblit constructors aren't compatible

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 29 17:09:06 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=21349

--- Comment #4 from Илья Ярошенко <ilyayaroshenko at gmail.com> ---
btw, I don't see whare spec says that an aggregate can't hold both old and new
style members

struct C
{
    SOld sOld;
    SNew sNew;
}

void main()
{
    C c;
    auto d = c;
    assert(d.sOld.s);
    assert(d.sNew.s);
}

This is a buggy definition too and doesn't pass second assert too.

The spec doesn't say that this shouldn't work.
It just ignores this case. But this is definitely the language design bug.

--


More information about the Digitalmars-d-bugs mailing list