www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 910] New: Error in description of "this" and "super" keywords

reply d-bugmail puremagic.com writes:
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 digitalmars.com
        ReportedBy: davidell 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]


-- 
Jan 31 2007
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=910


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED





Fixed DMD 1.005


-- 
Feb 12 2007