[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:03:09 PST 2014


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



--- Comment #11 from Vladimir Panteleev <thecybershadow at gmail.com> 2014-03-03 05:03:05 EET ---
(In reply to comment #10)
> But, latter semantic analysis will translate X!foo to X!foo.X again. The
> behavior is not directly related to the __traits(parent) behavior.

The __traits code runs semantic on its result immediately after calculating the
parent. So "later" here means "immediately after".

> I think it's not consistent behavior in generic case. For example:
> 
> 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 think that makes no sense. In the same spirit, you could argue that since the
parent of x is struct S, then x is a member of struct S.

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