<div dir="ltr"><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, 13 May 2025 at 04:51, Walter Bright 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 5/12/2025 4:16 AM, Manu wrote:<br>
> `scope` has nothing to do with @safe, and it MUST work in its own right, <br>
> otherwise the code is lying to the author, and it's an effective liability.<br>
<br>
An escape hatch is always needed.</blockquote><div><br></div><div>Well the primary escape hatch is, obviously, just don't write `scope` if it's not scope!</div><div>But I think you could divine an alternative escape hatch if required; like `cast(ref T)myScopeT` or something. Or alternatively just `cast(T)myScopeT` which might normally imply that a copy is made, but the language could detect the identity cast and elide the copy...</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
For example, you might want to interface with a 3rd party library that is <br>
scope-correct, but is not annotated with `scope`.<br></blockquote><div><br></div><div>Okay sure; find another solution. This one is insane. I suggest some form of cast().</div></div></div>