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

[email protected] changed:

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

--- Comment #2 from [email protected] ---
(In reply to lasssafin from comment #1)
> I'm not sure I follow: Why should opAssign be called?

Either a new Test is constructed by foo, but then the destructor should be
called on the old Test. Or the existing Test is used, but then opAssign should
be called instead of just writing Test.init over the old value.

I think the spec [1] is rather clear about which one should happen:

> out   parameter is initialized upon function entry with the default value for 
> its type

So I think the destructor should be called.


1 http://dlang.org/spec/function.html#parameters

--

Reply via email to