Discussion Thread: DIP 1035-- at system Variables--Community Review Round 2
Dukc
ajieskola at gmail.com
Tue Mar 2 15:17:54 UTC 2021
On Tuesday, 2 March 2021 at 14:57:04 UTC, Paul Backus wrote:
> I think you may be confusing the safety of a *value* with the
> safety of a *variable*.
No, I was thinking this piece:
> An exception to the above rules is made on unsafe types when
> the compiler knows the resulting value is safe.
> ```D
> int* getNull() pure @system {return null;}
> int* n = getNull(); // despite unsafe type with @system
> initialization expression, inferred as @safe
> ```
So the queastion is:
```D
ShortString getSString() pure @system {<...>}
//under what conditions, if any, is the initialization inferred
as @safe here?
ShortString n = getSString();
```
More information about the Digitalmars-d
mailing list