<div dir="ltr"><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, 12 May 2025 at 19:41, Richard (Rikki) Andrew Cattermole via Digitalmars-d <<a href="mailto:digitalmars-d@puremagic.com">digitalmars-d@puremagic.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 12/05/2025 9:24 PM, Manu wrote:<br>
> On Mon, 12 May 2025 at 03:55, Walter Bright via Digitalmars-d <br>
> <<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a> <mailto:<a href="mailto:digitalmars-d@puremagic.com" target="_blank">digitalmars-d@puremagic.com</a>>> wrote:<br>
> <br>
> On 5/10/2025 9:07 PM, Manu wrote:<br>
> > I tested that and it didn't work for me. Maybe my test was faulty<br>
> somehow since<br>
> > I was working through numerous combinations, I'll try it again...<br>
> <br>
> <br>
> I just tried it again, with the same result.<br>
> <br>
> <br>
> __gshared int* g;<br>
> void test(scope int* x)<br>
> {<br>
> g = x;<br>
> }<br>
> <br>
> I just compiled this with -dip1000, and it compiles... This looks like <br>
> an escape to me! What have I misunderstood here?<br>
<br>
Both ``__gshared`` and ``shared`` is disallowed by ``@safe`` (direct <br>
assign/access), and ``@safe`` has to be in use.<br>
<br>
``-preview=dip1000``<br>
<br>
```d<br>
int* g;<br>
void test(scope int* x) @safe {<br>
g = x; // Error: scope variable `x` assigned to global variable `g`<br>
}<br>
```<br>
<br>
</blockquote><div><br></div><div>`scope` shouldn't depend on @safe, and Walter above said it depended only on -dip1000.</div><div>So, if it only works with @safe, I repeat again; WHY? It's not only redundant annotation, but it's also a ticking bomb waiting to explode... I already commented on this.</div></div></div>