On Sunday, 7 April 2024 at 23:32:24 UTC, MrJay wrote:
A better way to apply a attribute to an entire file is to use an explicit scope you can still apply this to basically the entire file but leave the tests out of it.

Better than an explicit impure (or pure=false) attribute?
I don't think so. It heavily uglyfies the file, as single items without a specific attribute are interspersed in the file. So the scope need to end before and start again after the affected function or test.

An it stops working at all if e.g. one test is impure and another test is @gc, because then the scopes overlap and can no more be contained in each other.

Really, having the counter-attributes would improve the language.
  • Re: impure Jonathan M Davis via Digitalmars-d-learn
    • Re: impure Dom DiSc via Digitalmars-d-learn
      • Re: impure Jonathan M Davis via Digitalmars-d-learn
    • Re: impure MrJay via Digitalmars-d-learn
      • Re: impure Dom DiSc via Digitalmars-d-learn
    • Re: impure Alexandru Ermicioi via Digitalmars-d-learn

Reply via email to