[Issue 20831] __traits(getAttributes) failes to compile when used on a parameter with no name

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu May 14 14:26:07 UTC 2020


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |destructionator at gmail.com

--- Comment #1 from Adam D. Ruppe <destructionator at gmail.com> ---
I simplified the test a little more and see it changes based on order:


```
void main() {
        static if(is(typeof(foo) Params == __parameters))
                pragma(msg, __traits(getAttributes, Params[0..1]));
}

void foo(float) {}
```

That triggers it. Now move the definition of `foo` up above main:


```
void foo(float) {}
void main() {
        static if(is(typeof(foo) Params == __parameters))
                pragma(msg, __traits(getAttributes, Params[0..1]));
}
```

that works correctly. Looks like one of those semantic is not called at the
right time bugs.

--


More information about the Digitalmars-d-bugs mailing list