@safe function causes attribute inference since 2.072

Steven Schveighoffer schveiguy at gmail.com
Tue Apr 14 21:08:15 UTC 2020


On 4/14/20 4:25 PM, Walter Bright wrote:
> On 4/13/2020 8:17 AM, Steven Schveighoffer wrote:
>> Should this be a bug? I think at least the fact that inference only 
>> happens on structs inside @safe functions doesn't make sense (why not 
>> pure, @nogc nothrow functions).
> 
> Here's what you're looking for:
> 
> https://github.com/dlang/dmd/blob/master/src/dmd/func.d#L1245

Thanks. Looks like the real place where this was changed is probably here:

https://github.com/dlang/dmd/pull/5881

And then that was refactored.

Is there any reason why @safe functions are also affected? Is there any 
reason we shouldn't extend this to other attributed functions, or just 
all things inside a function context?

-Steve


More information about the Digitalmars-d mailing list