[Issue 20876] generated constructor always inout regardless of ability of fields to use inout

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Oct 10 22:28:14 UTC 2024


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

--- Comment #15 from Walter Bright <bugzilla at digitalmars.com> ---
An illustration of the generated copy constructor error:

struct S {
    this(ref S) { }
}

struct T {
    S s;
    this(inout ref T t)
    {
        this.s = t.s; // copy constructor `test.S.this(ref S __param_0)` is not
callable using argument types `(inout(S))`
    }
}

void test()
{
    T t;
    T u = t;
}

--


More information about the Digitalmars-d-bugs mailing list