[Issue 19092] __delete doesn't work with immutable

2018-08-07 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19092

--- Comment #6 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/a9c5df1fe7b253e67c20662d37545cfd02460cea
Fix Issue 19092 - __delete doesn't work with immutable

https://github.com/dlang/druntime/commit/df22381b0935ddae1322710fede499275f7b968b
Merge pull request #2253 from wilzbach/fix-19092

Fix Issue 19092 - __delete doesn't work with immutable

--


[Issue 19092] __delete doesn't work with immutable

2018-07-18 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19092

Seb  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 19092] __delete doesn't work with immutable

2018-07-18 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19092

--- Comment #5 from Mike Franklin  ---
> The issue is that the compiler deprecated `delete` and offers `__delete`as an 
> alternative (with destroy/free as optional) and it doesn't work as advertised!

`delete` was deprecated in favor of `destroy` and `free`ing functions. 
`__delete` was offered only as a last resort in case `destroy` was not
possible.  If you're reaching for `__delete` first, you are not using D as it
was intended to be used and you are only going to create problems for yourself
and for the maintainers of D.  Please avoid it, if possible.

--


[Issue 19092] __delete doesn't work with immutable

2018-07-18 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19092

Seb  changed:

   What|Removed |Added

 CC||greeen...@gmail.com

--- Comment #4 from Seb  ---
> As a side note, this is not the first time I report issues related to 
> const/immutable not being properly tested for druntime functions (__equals 
> caused a regression for immutable AA), I think making sure 
> cost/immutable/shared are covered for generic code should be a top priority 
> when reviewing code.

Aware of it, but sadly our review manpower isn't optimal at the moment and
sometimes things slip through.
However, any issue reported is certainly appreciated and (like here) we try to
fix it ASAP.

--


[Issue 19092] __delete doesn't work with immutable

2018-07-18 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19092

--- Comment #3 from Seb  ---
An attempt at fixing __delete - https://github.com/dlang/druntime/pull/2253

@JinShil: I agree but unfortunately for a seamless deprecation of delete,
__delete must be a full drop-in replacement.

--


[Issue 19092] __delete doesn't work with immutable

2018-07-18 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19092

--- Comment #2 from Radu Racariu  ---
The problem here is not if `delete` or `__delete` are correct or not. The issue
is that the compiler deprecated `delete` and offers `__delete`as an alternative
(with destroy/free as optional) and it doesn't work as advertised!


This is a very bad in terms of the overall perceived quality, I don't wanna go
into the reasoning of why `__delete` was added (or kept), but we have it and it
should work with all language constructs!

As a side note, this is not the first time I report issues related to
const/immutable not being properly tested for druntime functions (__equals
caused a regression for immutable AA), I think making sure
cost/immutable/shared are covered for generic code should be a top priority
when reviewing code.

--


[Issue 19092] __delete doesn't work with immutable

2018-07-18 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19092

Mike Franklin  changed:

   What|Removed |Added

 CC||slavo5...@yahoo.com

--- Comment #1 from Mike Franklin  ---
In principle, yes, `__delete` should be a drop-in replacement for `delete`, but
using `__delete` should be avoided unless all other options have failed.  In
fact, when `delete` was deprecated there was some resistance to creating
`__delete`.  In my opinion, all it does is encourage anti-patterns and
technical debt, and I wish `__delete` was never created.

What is the actual use case and why is `destroy` in combination with `free`ing
functions not possible?

--