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

Dennis dkorpel at gmail.com
Thu May 19 08:52:46 UTC 2022


On Thursday, 19 May 2022 at 08:30:58 UTC, Dukc wrote:
> Anyway I hope this addition won't make it to the next stable.

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




More information about the Digitalmars-d mailing list