[Issue 22992] New: std.traits: template instance is nested in both A and B with getSymbolsByUDA

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 6 18:05:12 UTC 2022


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 at puremagic.com
          Reporter: aliloko at 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?

--


More information about the Digitalmars-d-bugs mailing list