[Issue 7809] __traits(getMember can be used with a type although the spec says it cannot

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jan 8 12:52:26 PST 2013


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


Andrej Mitrovic <andrej.mitrovich at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich at gmail.com
         Resolution|                            |INVALID


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-01-08 12:52:23 PST ---
No, the error is in the assignment:

struct S
{
    int i;
}

void main()
{
    __traits(getMember, S, "i") = 1;
}

Error: need 'this' to access member i

The trait docs specifically state that all the trait does is forms an
expression. 

But I don't think we even need it anymore since we can use string mixins,
although it has to be around for backwards-compatibility.

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