www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22992] New: std.traits: template instance is nested in both A

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

          Issue ID: 22992
           Summary: std.traits: template instance is nested in both A and
                    B with getSymbolsByUDA
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: aliloko gmail.com

Consider the following program:


---- main.d --------

import std.traits: getSymbolsByUDA;

struct MyUDA
{
}

class A
{
     MyUDA int a;
}

class B : A
{
     MyUDA int b;
}

void main()
{
    alias G = getSymbolsByUDA!(B, MyUDA);
}


--------------------


That yield the error:
     Error: template instance `AliasSeq!(b, a)` `AliasSeq!(b, a)` is nested in
both `B` and `A`


Sounds like a bug in getSymbolsByUDA?
How to workaround that?

--
Apr 06 2022