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

Dmitry Olshansky <[email protected]> changed:

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

--- Comment #20 from Dmitry Olshansky <[email protected]> ---
(In reply to Orvid King from comment #19)
> We still wouldn't be able to call the destructors in structs for arrays even 
> with precise heap scanning, because we can't know that each value in the
> array 
> is actually valid. Take for instance an array of File's, it's not valid to
> call 
> the destructor of File.init, so we could compare the value of an element of
> an 
> array of structs to it's init value, but who's to say that element was ever 
> initialized in the first place? How would we detect that?

It's perfectly valid to call destructor on T.init. In fact compiler will always
do so with stack-allocated instances.

--

Reply via email to