www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18314] New: std.traits.getSymbolsByUDA only considers the

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

          Issue ID: 18314
           Summary: std.traits.getSymbolsByUDA only considers the first
                    symbol of an overload set
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: dechcaudron+dlang.issue.tracking protonmail.com

Consider the following code:

```
enum lol;
enum lal;

struct A
{
         lal
        void foo();
         lol
        void foo(int a);
}

void main()
{
        pragma(msg, "Tagged with  lal:");
        static foreach(alias member; getSymbolsByUDA!(A, lal))
        {
                pragma(msg, __traits(identifier, member));
        }

        pragma(msg, "Tagged with  lol:");
        static foreach(alias member; getSymbolsByUDA!(A, lol))
        {
                pragma(msg, __traits(identifier, member));
        }
}
```

When building, `foo` only shows up in the first foreach, not in the second one.

--
Jan 27 2018