www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17233] New: getSymbolsByUDA toSymbols error instantiating if

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

          Issue ID: 17233
           Summary: getSymbolsByUDA toSymbols error instantiating if
                    parent has same UDA field
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: code.viator gmail.com

```d
import std.traits;

enum myuda;

class A {  myuda int x; }

class B : A
{
     myuda int some;
    void foo() { foreach (s; getSymbolsByUDA!(typeof(this), myuda)) {} }
}

void main() { (new B).foo(); }
```

% rdmd uda_symbols.d
/usr/include/dmd/phobos/std/traits.d-mixin-7250(7250): Error: template
instance/AliasSeq!(some, x) AliasSeq!(some, x) is nested in both B and A
/usr/include/dmd/phobos/std/traits.d(7259): Error: template instance
std.traits.getSymbolsByUDA!(B, myuda).toSymbols!("some", "x") error
instantiating uda_symbols.d(10):        instantiated from here:
getSymbolsByUDA!(B, myuda)

--
Feb 28