Discussion Thread: DIP 1035-- at system Variables--Community Review Round 1

jmh530 john.michael.hall at gmail.com
Wed Jun 17 14:41:58 UTC 2020


On Wednesday, 17 June 2020 at 14:27:17 UTC, Andrei Alexandrescu 
wrote:
> [snip]
>
> Not even close. The crux of the matter is that forgetting to 
> add @system to that variable makes @safe code do unsafe things 
> with no diagnostic for the compiler. That's a problem with the 
> safety system, regardless of the adoption of this DIP. We can't 
> say "@safe D code is safe, except of course if you forget to 
> insert @system on key variables, in which case it won't be with 
> no warning."
>

That is a fair point.

One potential resolution would be to allow for 
@safe/@trusted/@system (with @system the default) variable 
initialization and prevent taking the address of a @system 
variable in a @safe function.



More information about the Digitalmars-d mailing list