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

ag0aep6g <[email protected]> changed:

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

--- Comment #2 from ag0aep6g <[email protected]> ---
(In reply to Seb from comment #1)
> So DMD already does transitively apply @safe, but apparently if it generated
> for associative arrays this generation doesn't work in all cases.

It's not the associative array. It's just that the generated opAssign isn't
@safe (for no reason):

----
void main() @safe
{
    struct ThrowingElement
    {
        ~this() {}
    }

    ThrowingElement aa;
        /* Accepted. The destructor is apparently inferred as @safe. */
    aa = aa;
        /* Error: @safe function D main cannot call @system generated
        function onlineapp.main.ThrowingElement.opAssign */
}
----

--

Reply via email to