Please, can the langauge stop inferring scope and return for @trusted/@system?

Dukc ajieskola at gmail.com
Thu May 19 09:11:49 UTC 2022


On Thursday, 19 May 2022 at 08:52:46 UTC, Dennis wrote:
> The reason run.dlang.io / dmd 2.099 allows it is that it failed 
> to propagate lifetimes of `return ref` parameters through 
> constructors, so it doesn't consider `myVar` `scope`. It would 
> give an error about assigning `i` to the `otherPtr` member, but 
> you marked the constructor `@trusted`. See:
>
> https://issues.dlang.org/show_bug.cgi?id=22801

Thanks. So it was a bug hiding another bug (or just controversial 
design - you decide).


More information about the Digitalmars-d mailing list