www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11545] New: Aggregate function literal member should not have access to enclosing scope

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

           Summary: Aggregate function literal member should not have
                    access to enclosing scope
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: d+bugzilla garciat.com


--- Comment #0 from Gabriel Garcia <d+bugzilla garciat.com> 2013-11-18 17:55:53
PST ---
import std.stdio;

class hello {
    int x = 42;

    // should not have access to `this.*`
    int function() f = function() {
        // accesses `this.x`
        return x;
    };
}

void g(int function() h) {
    writeln(h());
}

void main() {
    auto h = new hello();

    // outputs 42
    writeln(h.f());

    // segfaults
    g(h.f);
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 18 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11545



--- Comment #1 from Gabriel Garcia <d+bugzilla garciat.com> 2013-11-18 17:56:25
PST ---
*** Issue 10336 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 18 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11545


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull, wrong-code
           Severity|trivial                     |major


--- Comment #2 from Kenji Hara <k.hara.pg gmail.com> 2013-11-19 00:20:56 PST ---
https://github.com/D-Programming-Language/dmd/pull/2824

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 19 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11545


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |luka8088 owave.net


--- Comment #3 from Kenji Hara <k.hara.pg gmail.com> 2013-11-21 18:54:07 PST ---
*** Issue 6801 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 21 2013
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11545


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |timon.gehr gmx.ch


--- Comment #4 from Kenji Hara <k.hara.pg gmail.com> 2014-02-03 06:29:34 PST ---
*** Issue 7653 has been marked as a duplicate of this issue. ***

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 03 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11545



--- Comment #5 from github-bugzilla puremagic.com 2014-03-14 01:03:33 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/180a6aabbb5d5db72e6650f8cedc4ba4b7899017
fix Issue 11545 - Aggregate function literal member should not have access to
enclosing scope

https://github.com/D-Programming-Language/dmd/commit/195a3b17d5e759eeafb099bb4612bc7dcc12d8f8
Merge pull request #2824 from 9rnsr/fix11545

Issue 11545 - Aggregate function literal member should not have access to
enclosing scope

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 14 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11545


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

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


-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 14 2014