[Issue 20744] [The D Bug Tracker] UDAs on function parameters confuse std.traits.ParameterDefaults

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 17 16:58:10 UTC 2020


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

Adam D. Ruppe <destructionator at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |destructionator at gmail.com
          Component|dlang.org                   |dmd

--- Comment #1 from Adam D. Ruppe <destructionator at gmail.com> ---
this works though:


import std.traits;

struct attr;
void f(@attr int g = 4);

void main() {
        pragma(msg, ParameterDefaults!f.stringof);
}


But this does not:


struct S{
        pragma(msg, ParameterDefaults!f.stringof);
}


Looks like if the ParameterDefaults appears in function scope, it works, but
otherwise it fails.

Order doesn't seem to matter, if I eval the pragma in a function first then in
a struct later it still errors in the struct.

I'm gonna change the component here to dmd since I think it is the compiler's
fault rather than the library's

--


More information about the Digitalmars-d-bugs mailing list