Bug 12712 – __traits(parent, X.Y) recurs X for template struct X with repeated applications of __traits(parent, ...)
Status
RESOLVED
Resolution
DUPLICATE
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2014-05-07T04:00:00Z
Last change time
2014-05-07T07:40:51Z
Assigned to
nobody
Creator
soltanmm
Comments
Comment #0 by soltanmm — 2014-05-07T04:00:18Z
This issue is really similar to issue 12496 (https://issues.dlang.org/show_bug.cgi?id=12496). There's a reference to another bug, but as I could not find that issue going off of just the name 'Vladimir', and as I have a slightly different form (templates vs. mixins) and don't know the specifics of the compiler's inner workings, I'm filing this as a new bug.
-- BEGIN CODE --
module something;
struct A(T)
{
static struct B {}
}
pragma(msg,__traits(parent,__traits(parent,__traits(parent,A!int.B))));
-- END CODE --
The resulting output is `A!int` as opposed to `something` on the second application of parent, and again `A!int` as opposed to an error (or whatever the compiler should be responding with to a request for a parent from a top-level module) on the following application.
Thanks for your time~!
Comment #1 by andrej.mitrovich — 2014-05-07T07:40:51Z
*** This issue has been marked as a duplicate of issue 12287 ***