www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 24227] New: Add a trait to check if symbol is an alias

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

          Issue ID: 24227
           Summary: Add a trait to check if symbol is an alias
           Product: D
           Version: D2
          Hardware: All
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: msnmancini hotmail.com

I have been trying to auto generate some code, and then I've found this
problem:

```d

class MyClass
{
    void member1();
    alias mem = member1;
}

static foreach(mem; __traits(derivedMembers, MyClass))
{
    pragma(msg, __traits(getMember, MyClass, mem).stringof); //member1 printed
twice
}
```

This way, I can't dynamically generate code where I have aliases.

Related Issue? https://issues.dlang.org/show_bug.cgi?id=19029

--
Nov 04 2023