Re: Labelled @nogc Working With Inner Scopes

2021-08-31 Thread Benoît Dubreuil via Digitalmars-d-learn
On Monday, 30 August 2021 at 20:58:01 UTC, Ali Çehreli wrote: I don't have a strong opinion on the question but I tend to agree with the current behavior because it's easy to add the attributes anyway. On Tuesday, 31 August 2021 at 00:36:46 UTC, Mike Parker wrote: Attributes used to propagate

Re: Labelled @nogc Working With Inner Scopes

2021-08-30 Thread Mike Parker via Digitalmars-d-learn
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 orde

Re: Labelled @nogc Working With Inner Scopes

2021-08-30 Thread Ali Çehreli via Digitalmars-d-learn
I don't have a strong opinion on the question but I tend to agree with the current behavior because it's easy to add the attributes anyway. Going off topic, I want to mention that the 'in' and 'out' contracts have a simpler syntax now and that the 'do' (or 'body') keyword is optional in that p

Labelled @nogc Working With Inner Scopes

2021-08-30 Thread Benoît Dubreuil via Digitalmars-d-learn
I've got the following module `dummy.dummy.d`: ```d module dummy; @safe: @nogc: struct Dummy { // TODO: Why do I need to repeat those? Aren't the formers still effective for inner scopes? @safe: @nogc: static const int MAX_MEMBER_INT = 3; int memberInt; string memberStr;