Understanding DIP 1000 semantics -- Where's the bug?
anonymous at example.com
Sun Sep 22 17:54:48 UTC 2019
On Sunday, 22 September 2019 at 17:26:20 UTC, Mike Franklin wrote:
> Interestingly, taking the address of a `ref` in `@safe` code is
> prevented, but only when compiling *without* -preview=dip1000.
> See https://run.dlang.io/is/GArFzk
> That's seems like a bug to me.
That's just the normal pre-DIP-1000 error you get when taking the
address of any local (`ref` or not). Allowing `&some_local` is
pretty much the point of DIP 1000, so it's expected that the old
error doesn't appear anymore.
There is a bug for sure, though. If `ref` implies `scope`, there
should be a new error ("cannot take address of scope parameter").
If `scope` is not implied, it's ok that the function compiles,
but then it shouldn't be possible to call it on a local.
More information about the Digitalmars-d