[Issue 24162] Another example of why @safe is broken

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Oct 2 09:02:38 UTC 2023


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

Nick Treleaven <nick at geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick at geany.org

--- Comment #8 from Nick Treleaven <nick at geany.org> ---
I don't think we should ban passing a reference to an element and also a
reference to the array. This can be perfectly valid, for example when the
element reference is only modified before the array is resized. Also when the
element reference is only read, even after the resize. Also when mutating the
element reference is still accessible in another slice of the array even after
the array reference is resized. So there are lots of valid situations we
shouldn't break.

--


More information about the Digitalmars-d-bugs mailing list