DIP1000 scope inference

rikki cattermole rikki at cattermole.co.nz
Tue Oct 25 02:13:20 UTC 2022


On 25/10/2022 3:09 PM, Paul Backus wrote:
> For example, the `@trusted` function below is memory safe when using the 
> current compiler release, but will become unsafe when compiled with DMD 
> 2.101:
> 
> ```d
> @trusted int[] example()
> {
>      scope example = [1, 2, 3];
>      return example;
> }
> ```

Does this also apply to @safe?


More information about the Digitalmars-d mailing list