Bug 22992 – std.traits: template instance is nested in both A and B with getSymbolsByUDA
Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2022-04-06T18:05:12Z
Last change time
2022-04-08T09:59:11Z
Assigned to
No Owner
Creator
ponce
Comments
Comment #0 by aliloko — 2022-04-06T18:05:12Z
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?
Comment #1 by moonlightsentinel — 2022-04-08T09:59:11Z