<div dir="ltr"><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Mon, 12 May 2025 at 21:10, 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 10:55 PM, Manu wrote:<br>
> `scope` shouldn't depend on @safe, and Walter above said it depended <br>
> only on -dip1000.<br>
> So, if it only works with @safe, I repeat again; WHY? It's not only <br>
> redundant annotation, but it's also a ticking bomb waiting to explode... <br>
> I already commented on this.<br>
<br>
@safe is the static analysis on a function that the compiler guarantees <br>
is memory safe.<br></blockquote><div><br></div><div>
`scope` has nothing to do with <a class="gmail_plusreply" id="gmail-plusReplyChip-6">@safe. </a>I want to prohibit the callee retaining the argument; simple as that.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
@trusted is the escape hatch where you have to do something that the <br>
compiler cannot make guarantees for.<br></blockquote><div><br></div><div>This has nothing to do with @safe.</div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
@system has no guarantees associated with it.<br>
<br>
All scope says is that this variable will not escape this function.</blockquote><div><br></div><div>Exactly. Nothing to do with @safe.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
It does not have any kind of ownership properties.<br></blockquote><div><br></div><div>Correct.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
It is not redundant information, it does serve an important purpose in <br>
escape analysis.<br></blockquote><div><br></div><div>Incorrect.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
When you see no attributes, think unknown escape behavior, it is not <br>
modeled. Not, this doesn't escape, or it escapes into an unknown <br>
location. These are all different things.<br></blockquote><div><br></div><div>Okay, I'll repeat for the 3rd time or so; when `scope` is annotated to an argument, it MUST have effect, otherwise an escape related crash is inevitable that the user intended to prevent, and when they start debugging and trying to track down the issue; they will see the `scope` annotation, assume it's not that, then move on to continue looking in the wrong place for their issue.</div><div><br></div><div>`scope` has nothing to do with @safe, and it MUST work in its own right, otherwise the code is lying to the author, and it's an effective liability.</div></div></div>