[Issue 11048] Default arguments bypass most attributes check (pure, @safe, @nogc)

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Nov 9 00:21:32 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=11048

Mathias LANG <pro.mathias.lang at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pro.mathias.lang at gmail.com
            Summary|Default arguments not taken |Default arguments bypass
                   |into account when being     |most attributes check
                   |called by pure functions    |(pure, @safe, @nogc)

--- Comment #3 from Mathias LANG <pro.mathias.lang at gmail.com> ---
This applies to all attributes but `nothrow`, but only because `nothrow` is the
very last to be checked.
E.g. this compiles:
```
int doit() { return 42; }
void f(int i = doit()) nothrow @safe pure @nogc {}
void main() /* nothrow */ @safe pure @nogc { f(); }
```

--


More information about the Digitalmars-d-bugs mailing list