www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3787] New: clarification: assigment to 'this'

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3787

           Summary: clarification: assigment to 'this'
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: major
          Priority: P2
         Component: www.digitalmars.com
        AssignedTo: nobody puremagic.com
        ReportedBy: johannespfau gmail.com



PST ---
Created an attachment (id=564)
Example of assignment to this

Assigning to 'this' is currently not documented anywhere. Still assigning to
this, at least in constructors, works and is used by some code (gtkd, for
example). I think assigning to this should either work in constructors as it
does right now, but it then should be documented, or it should be disallowed.
If it will stay implementation specific, that should still be noted in the
docs.

see also: http://d.puremagic.com/issues/show_bug.cgi?id=780 The assignment of
'this' is allowed

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 09 2010
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3787


Andrei Alexandrescu <andrei metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andrei metalanguage.com



08:42:34 PST ---
This doesn't look major.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 09 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3787


Johannes Pfau <johannespfau gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P2                          |P3
           Severity|major                       |normal



PST ---
I just thought if you'd disallow assignment to this completely as the poster in
bug 780 suggests, you might want to discuss that in the newsgroup. As this is
quite late for d2 I flagged it major. Also I think completely undocumented and
undefined features being already used in production code (gtkd) is a bad thing.
However, I hadn't seen the bugzilla fields explanation, sorry. I'll change the
priority.

Btw, what is most likely to happen in the end?
1: make current behavior part of specification
2: disallow assignment to this completely
3: leave this as implementation specific behavior

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 09 2010
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3787


Walter Bright <bugzilla digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla digitalmars.com



13:34:48 PST ---
Assignment to this and super should not be allowed.

The gtkd code can be fixed by making a 'factory' method to create a new object.
However, this is not a trivial fix, and so having the compiler disallow the
current code should be a long time in coming.

In the meantime, I've updated the spec.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 22 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3787




Commit pushed to
https://github.com/D-Programming-Language/d-programming-language.org

https://github.com/D-Programming-Language/d-programming-language.org/commit/83763c15e1ecd9fbf527fa1e9e979855cabc5a81
fix Issue 3787 - clarification: assigment to 'this'

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 22 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3787


Walter Bright <bugzilla digitalmars.com> changed:

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


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