Labelled @nogc Working With Inner Scopes

Mike Parker aldacron at gmail.com
Tue Aug 31 00:36:46 UTC 2021


On Monday, 30 August 2021 at 20:26:46 UTC, Benoît Dubreuil wrote:
>
>
> My question is:
>> In the source file `dummy.dummy.d`, why the first labelled 
>> attributes `@safe` and `@nogc` have no effect inside the 
>> struct's scope? In other words, why do I need to repeat 
>> labelled attributes statements in order to affect inner scopes?
>
> To test this, simply remove in `dummy.dummy.d` the *TODO* 
> comment and its following labelled attributes.

Attributes used to propagate into aggregate definitions, but it 
was changed a long time ago. I don't recall the reason why.


More information about the Digitalmars-d-learn mailing list