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

           Summary: Wrong error message with __traits(getMember
           Product: D
           Version: future
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-04-03 12:01:17 PDT ---
struct Test {
    void hello() {}
}
void main() {
    Test t;
    string m = "hello";
    __traits(getMember, t, m)(); // line 7
}


dmd 2.042 gives:

test.d(7): Error: string expected as second argument of __traits getMember
instead of m
test.d(7): Error: function expected before (), not false of type bool


Defining m as const,immutable or enum string avoids this error. So those two
error messages are bad. Something better can be:

test.d(7): Error: the second argument of __traits getMember must be a not
mutable string.

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

Reply via email to