@trusted attribute should be replaced with @trusted blocks

Timon Gehr timon.gehr at gmx.ch
Fri Jan 17 18:19:54 UTC 2020

On 17.01.20 09:10, Johannes Pfau wrote:
> Am Thu, 16 Jan 2020 04:34:26 +0100 schrieb Timon Gehr:
> ...
> I'm curious, what do you think would be the ideal scheme if we could
> redesign it from scratch?

Different approaches have different trade-offs and I am not sure how to 
weight the benefits and drawbacks. However, whatever the final solution 
is, the type system should not make a difference between @safe and 
@trusted function signatures.

> Only @safe/@system as function attributes and
> @trusted (or @system) blocks which can be used in @safe functions?

I do not particularly like this option. @trusted blocks are better than 
@system blocks, but an implicit assumption many people are still going 
to make is that only the code inside the block is @trusted, and this 
will typically be incorrect.

More information about the Digitalmars-d mailing list