[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:53:36 PST 2014


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



--- Comment #14 from Vladimir Panteleev <thecybershadow at gmail.com> 2014-03-03 05:53:28 EET ---
(In reply to comment #13)
> The semantic will return ScopeExp, and it still contain the TemplateInstance
> object. So you are misunderstanding.

I just checked again with a debugger and this is not what I am seeing. The
returned expression is a TypeExp, with the type being the TypeStruct pointing
at the struct of course.

> I don't understand what you saying. The parent of struct S and variable x is
> the template instance S!int. There's nothing else.

Maybe I am wrong but from looking at what is going on with a debugger I don't
see that happening.

But even if you are right, isn't the correct fix to move the replacing of the
template instance with the eponymous member so that it doesn't happen with
chained __traits(parent)?

Your library solution is a crutch; I don't think there should ever be a case
where __traits(parent) enters an infinite loop.

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