On Borrow Checking

Nick Treleaven nick at geany.org
Mon May 12 14:50:05 UTC 2025


On Monday, 12 May 2025 at 11:52:47 UTC, Richard (Rikki) Andrew 
Cattermole wrote:
> On 12/05/2025 11:16 PM, Manu wrote:
> We should disallow it for @system functions, they do not 
> interact with any static analysis in any way.

`scope` on a `@system` function parameter is not only useful as a 
form of documentation, it actually also affects the caller:

```d
void f(scope int[]) @nogc;

void g() @nogc
{
     f([1, 2]);
}

```
Remove `scope`, it no longer compiles.


More information about the Digitalmars-d mailing list