www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4596] New: Rebinding *this* in class method compiles

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

           Summary: Rebinding *this* in class method compiles
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2010-08-07
17:43:48 PDT ---
This should not compile (from TDPL):

import std.stdio;

class NoGo {
    void fun() {
        this = new NoGo;
    }
}

void main() { }

unittest {
    auto n = new NoGo;
    n.fun();
}

There are no runtime errors.

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


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
           Platform|Other                       |All
         OS/Version|Windows                     |All


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2011-12-25 02:30:01 PST ---
Added fix into pull#166.
https://github.com/D-Programming-Language/dmd/pull/166

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 25 2011
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4596



--- Comment #2 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2012-01-21
16:57:35 PST ---
This also seems a dup of Issue 780, so that should be closed when that pull is
merged.

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



--- Comment #3 from Kenji Hara <k.hara.pg gmail.com> 2012-01-22 05:10:14 PST ---
(In reply to comment #2)
 This also seems a dup of Issue 780, so that should be closed when that pull is
 merged.
Bug 780 is marked as D1 issue. And my patch contains some other fixes around assignment, so merging the changes into D1 branch will be difficult. In other words, D1 branch will require another patch to fix the "rebinding this" problem. So I think we should not close bug 780 by merging my patch into D2. -- 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=4596



--- Comment #4 from github-bugzilla puremagic.com 2012-10-07 10:27:24 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/727263351eec94c979e7f718509de3afde4cbb30
fix Issue 4596 - [tdpl] Rebinding *this* in class method compiles

https://github.com/D-Programming-Language/dmd/commit/c4324fd970f31c39b7efe96e4acfe26732925edf
Merge pull request #1169 from 9rnsr/fix4596

Issue 4596 - [tdpl] Rebinding *this* in class method compiles

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


yebblies <yebblies gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies gmail.com
         Resolution|                            |FIXED


--- Comment #5 from yebblies <yebblies gmail.com> 2012-10-08 05:51:16 EST ---
https://github.com/D-Programming-Language/dmd/commit/c4324fd970f31c39b7efe96e4acfe26732925edf

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



--- Comment #6 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2012-11-27
17:15:02 PST ---
Note: http://d.puremagic.com/issues/show_bug.cgi?id=9079#c2

And Walter's comment: http://d.puremagic.com/issues/show_bug.cgi?id=780#c3

I'm not sure whether we should revert this or not. Those 4 steps Walter
mentioned could have already been taken since this report was first made (even
though he mentions it only this year).

Unfortunately this is what happens when development procedures are written in
comments instead of a more visible place..

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



--- Comment #7 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2012-11-27
17:16:24 PST ---
(In reply to comment #6)
 Unfortunately this is what happens when development procedures are written in
 comments instead of a more visible place..
Actually things aren't *that* grim, because this only affects Git head. So the pull for this can be reverted without much problems methinks.. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Nov 27 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4596


Mike Wey <mike-wey planet.nl> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mike-wey planet.nl


--- Comment #8 from Mike Wey <mike-wey planet.nl> 2012-12-31 03:22:10 PST ---
http://d.puremagic.com/issues/show_bug.cgi?id=780#c3 :
 Since code like gtkd relies on allowing it,
Since reverting this has come up a few times already, i'd like to note that GtkD no longer depends on reassigning this. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Dec 31 2012