[Issue 18529] .ptr on arrays can no longer be used in @safe code prevents valid code

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Feb 27 08:39:45 UTC 2018


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

--- Comment #2 from Timothee Cour <timothee.cour2 at gmail.com> ---
> No, array's ptr can't be blindly dereferenced

indeed, I never said .ptr can be dereferenced; as I stated, this is no
different from `class A{...} A a;` where `a` can't be dereferenced

We shouldn't deprecate unless we can suggest to users a valid alternative for
`a.ptr`; as I showed, `&a[0]` is not equivalent (in case a.length==0) and it
breaks valid code.

Anecdotically, all of core.demangle is broken.

--


More information about the Digitalmars-d-bugs mailing list