May 07, 2014
https://issues.dlang.org/show_bug.cgi?id=12712

          Issue ID: 12712
           Summary: __traits(parent, X.Y) recurs X for template struct X
                    with repeated applications of __traits(parent, ...)
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: DMD
          Assignee: nobody@puremagic.com
          Reporter: soltanmm@gmail.com

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~!

--