D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 22992 - std.traits: template instance is nested in both A and B with getSymbolsByUDA
Summary: std.traits: template instance is nested in both A and B with getSymbolsByUDA
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: All All
: P1 major
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-04-06 18:05 UTC by ponce
Modified: 2022-04-08 09:59 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description ponce 2022-04-06 18:05:12 UTC
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 moonlightsentinel 2022-04-08 09:59:11 UTC
Works since 2.099 according to run.dlang.io