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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 27 00:14:05 PST 2010


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



--- Comment #1 from iorlas <denis.tomilin at gmail.com> 2010-01-27 00:14:04 PST ---
I've tried to fix this problem and I've found this part of code, what can say
about this problem:
>Object *o = (Object *)args->data[0];
>Expression *e = isExpression((Object *)args->data[1]);
>if (!e)
>{   error("expression expected as second argument of __traits %s", ident->toChars());
>    goto Lfalse;
>}
>e = e->optimize(WANTvalue | WANTinterpret);
>if (e->op != TOKstring)
>{   error("string expected as second argument of __traits %s instead of %s = %d", ident->toChars(), e->toChars(), e->op);
>    goto Lfalse;
>}
(traits.c)
Problem in this code. This code want to see const string expression(every const
string in the code). Program fails in this string:
>if (e->op != TOKstring)
Cuz e->op == TOKvar.

As i think, need to get an string from var and send it into StringExp instance
for next operations, but i donts know how.
Now i trying to find similar code in other sources.

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