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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 26 15:50:49 PST 2010


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

           Summary: __traits getMember error in checking of second
                    argument
           Product: D
           Version: 2.040
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: blocker
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: denis.tomilin at gmail.com


--- Comment #0 from iorlas <denis.tomilin at gmail.com> 2010-01-26 15:50:48 PST ---
Created an attachment (id=557)
Example code

I've trying to get text representation of class, that can be changed in
development time.
For this problem i've used __traits functions "allModules",
"isVirtualFunction"(for filtering) and "getMember" for getting a type by member
name(from "allModules").
But i've stuck in "getMember".

>Error: string expected as second argument of __traits getMember instead of m
(see code in attachment)
in
>if (!__traits(isVirtualFunction, __traits(getMember, Check, m))){
As said in references:
>Takes two arguments, the second must be a string.

Ofc, m is normal string. I've tried to use "writeln(typeid(typeof(m)));" for
determinating a type of m-variable.
>immutable(char)[]
as printed in console. That means all ok.
But __traits still throws error.

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