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

Nick Treleaven <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #1 from Nick Treleaven <[email protected]> ---
I think the move line should be disallowed:

A a = move(b);    // implicit copy, currently allowed
A a = move(b).a;  // currently disallowed by @disable this(this)

(The second line is equivalent, just expanding via alias this).

I think this test case may be the same bug:

struct A {
    @disable this(this); // Prevent copying
}

struct B {
    A a;
    alias a this;
}

void main() {
    A a = B(); // implicit copy of temporaryB.a should be disallowed
}

--

Reply via email to