[Issue 18314] New: std.traits.getSymbolsByUDA only considers the first symbol of an overload set
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jan 27 14:00:31 UTC 2018
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 at puremagic.com
Reporter: dechcaudron+dlang.issue.tracking at 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.
--
More information about the Digitalmars-d-bugs
mailing list