[Issue 3744] __traits getMember error in checking of second argument

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 27 01:41:09 PST 2010


http://d.puremagic.com/issues/show_bug.cgi?id=3744



--- Comment #3 from iorlas <denis.tomilin at gmail.com> 2010-01-27 01:41:07 PST ---
(In reply to comment #2)
> e->optimize(WANTvalue|WANTinterpret) should have turned it into a TOKstring. If
> it's still a TOKvar, then the problem is in e->optimize or earlier.
Hm. Huh, why Walter don't wrote a comments for sly functions like this...
interesting, I dunno how can miss word "WANT" in "WANTvalue", but I did it +_+.
Ok, good logic, but i cant find an implementation of this function.
It must be predefined in expressions.h. And i found this:
>struct VarExp : SymbolExp{
> ...
> Expression *optimize(int result);
> ...
>}
Aha!
But implementation there's in another file - optimize.c:
>Expression *VarExp::optimize(int result)
>{
>    return fromConstInitializer(result, this);
>}
Yeah, good.

This func found in this file:
>Expression *fromConstInitializer(int result, Expression *e1)
Only this part interesting for me, cuz it returns 0, that means returns
original  argument("this", with TOKvar):
>e = expandVar(result, v);

Next...
>Expression *expandVar(int result, VarDeclaration *v)
>if (v->isConst() || v->isImmutable() || v->storage_class & STCmanifest)
Yeah! It fails ;_;
But, stop! WTF? This function dont checks a WANTvalue flag and... i dunno.
I want to cry.. really. I want to solve this problem cuz its blocked my work.

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


More information about the Digitalmars-d-bugs mailing list