[Issue 910] New: Error in description of "this" and "super" keywords

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jan 31 01:09:00 PST 2007


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

           Summary: Error in description of "this" and "super" keywords
           Product: D
           Version: unspecified
          Platform: All
               URL: http://www.digitalmars.com/d/expression.html
        OS/Version: All
            Status: NEW
          Keywords: spec
          Severity: normal
          Priority: P2
         Component: www.digitalmars.com
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: davidell at earthling.net


In the descriptions of <b>this</b> and <b>super</b>, this page says "Within a
non-static member function, <b>this</b> resolves to a reference to the object
that called the function." This seems to be a mistake. A function couldn't and
shouldn't have information about its caller. Plus, functions are called by
functions, not by objects.

My suggestion for a description of <b>this</b> is as follows:
Within a non-static member function, <b>this</b> resolves to a reference to the
object for which the function was called — the current object, whose members
are in the current scope. [second sentence unchanged]

And <b>super</b> could be described quite consisely:
<b>super</b> is identical to <b>this</b>, except that it is cast to
<b>this</b>'s base class. [next four sentences unchanged]


-- 



More information about the Digitalmars-d-bugs mailing list