Discussion Thread: DIP 1035-- at system Variables--Community Review Round 2
Paul Backus
snarwin at gmail.com
Tue Mar 2 14:09:01 UTC 2021
On Tuesday, 2 March 2021 at 11:48:09 UTC, Dukc wrote:
> On Tuesday, 2 March 2021 at 02:46:58 UTC, Paul Backus on the
> feedback thread wrote:
>> On Monday, 1 March 2021 at 23:38:28 UTC, Dukc wrote:
>>> Which leads to, what are the values compiler considers to be
>>> safe?
>>
>> The answer to this question is is already part of the language
>> spec:
>>
>> https://dlang.org/spec/function.html#safe-values
>
> Yes, you can use that. But the dip needs to update that part of
> the spec, since what is going to be a safe struct instance /
> union instance / class ref value is changing. For instance,
> what the compiler will consider safe values for the
> `ShortString` struct provided in the example?
Good point. For user-defined unsafe types like ShortString, the
compiler will have to assume that any value that can be obtained
in @safe code is a safe value.
More information about the Digitalmars-d
mailing list