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

Dennis dkorpel at gmail.com
Thu May 19 10:48:13 UTC 2022


On Thursday, 19 May 2022 at 10:21:00 UTC, Dukc wrote:
> But if such implementation-dependent checks cause the same 
> function to compile with different semantics, then it's a 
> problem.

You're raising a valid concern, but this is a problem whether 
`scope` inference is enabled in `@trusted` code or not. One 
implementation could infer an unannotated function `@system` 
because it thinks `scope` pointers might escape, and a smarter 
implementation could find it's actually `@safe`, resulting in 
different mangling, different `is(F == G)`, different 
`__traits(compiles)` etc.



More information about the Digitalmars-d mailing list