Simplification of @trusted

Dukc ajieskola at gmail.com
Thu Jun 17 18:25:50 UTC 2021


On Thursday, 17 June 2021 at 18:02:26 UTC, Ola Fosheim Grøstad 
wrote:
> So if I control `module_0` and `module_a` depends on it, then I 
> can assume the invariants for types in `module_0` as long as 
> `module_b` cannot break those invariants from @safe code?

Well, if you make `module_0` or `module_a` unsound with your 
changes to `module_0`, then there's no telling what `module_b` 
will pass to your `@trusted` functions. But yes you can assume 
those invariants as long as your API is sound when the invariants 
hold.


More information about the Digitalmars-d mailing list