dip1000 and preview in combine to cause extra safety errors
deadalnix
deadalnix at gmail.com
Mon Jun 13 13:25:57 UTC 2022
On Monday, 13 June 2022 at 12:02:31 UTC, John Colvin wrote:
> Without expressing an opinion either way, I want to note that
> this has implications for `@nogc`. If you remove `scope` from
> the parameter of `foo`, the compiler won't let `main` be
> `@nogc` due to the slice literal allocation.
>
> string foo(scope string s) @nogc {
> return s;
> }
>
> void main() @nogc {
> foo(['a']);
> }
It's as if @nogc should track leaks and not allocations...
More information about the Digitalmars-d
mailing list