[Issue 12287] infinite loop on std.traits.moduleName on templated struct member

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Mar 2 19:14:16 PST 2014


https://d.puremagic.com/issues/show_bug.cgi?id=12287



--- Comment #12 from Vladimir Panteleev <thecybershadow at gmail.com> 2014-03-03 05:14:12 EET ---
(In reply to comment #10)
> template S(T)
> {
>     struct S {}
> 
>     int x;
>     static assert(__traits(isSame, __traits(parent, S),
>                                    __traits(parent, x)));
> }
> alias s = S!int;
> 
> Your change will break this case.

I've amended my pull so that it does not break this case. Now the parent of any
member of an eponymous template is the template instantiation's parent, not
just the eponymous member.

BTW, why is the parent of a template instantiation not the template
declaration? Right now it goes right to the module. I think going through the
declaration would be more logical.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list