Shouldn't invalid references like this fail at compile time?
Mike Franklin
slavo5150 at yahoo.com
Tue Jan 23 01:34:30 UTC 2018
On Tuesday, 23 January 2018 at 01:08:19 UTC, ag0aep6g wrote:
> If you add `@safe`, the compiler rejects this line:
>
> ls ~= &foo;
>
> But that line would only be problematic if the pointer would
> leave the scope of the function. It doesn't, so this is
> actually safe. But the compiler isn't smart enough to see this.
https://issues.dlang.org/show_bug.cgi?id=18281
More information about the Digitalmars-d
mailing list