[Issue 4819] New: "this" in classes should not an lvalue

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Sep 5 09:06:04 PDT 2010


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

           Summary: "this" in classes should not an lvalue
           Product: D
           Version: D1 & D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: jemandy at earthlink.net


--- Comment #0 from John Mandeville <jemandy at earthlink.net> 2010-09-05 09:05:44 PDT ---
"this" is treated as an lvalue.  For classes, it should
be an rvalue.  In particular, the following absurdity
compiles in v1.063 and v.2.047 but should not.

class Yikes
{
    int i;
    this() { this = null; }
}


void main()
{
    auto y = new Yikes();
}

See also discussion at
http://www.digitalmars.com/d/archives/digitalmars/D/this_as_lvalue_116836.html

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