Bug 17233 – getSymbolsByUDA toSymbols error instantiating if parent has same UDA field
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-02-28T09:47:04Z
Last change time
2020-08-27T22:20:22Z
Assigned to
No Owner
Creator
Oleg B
Comments
Comment #0 by code.viator — 2017-02-28T09:47:04Z
```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)
Comment #1 by boris2.9 — 2020-08-27T22:20:22Z
*** This issue has been marked as a duplicate of issue 17870 ***