Bug 11545 – Aggregate function literal member should not have access to enclosing scope

Status
RESOLVED
Resolution
FIXED
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-18T17:55:00Z
Last change time
2014-07-15T05:39:14Z
Keywords
pull, wrong-code
Assigned to
nobody
Creator
d+bugzilla
Blocks
12230

Comments

Comment #0 by d+bugzilla — 2013-11-18T17:55:53Z
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); }
Comment #1 by d+bugzilla — 2013-11-18T17:56:25Z
*** Issue 10336 has been marked as a duplicate of this issue. ***
Comment #2 by k.hara.pg — 2013-11-19T00:20:56Z
Comment #3 by k.hara.pg — 2013-11-21T18:54:07Z
*** Issue 6801 has been marked as a duplicate of this issue. ***
Comment #4 by k.hara.pg — 2014-02-03T06:29:34Z
*** Issue 7653 has been marked as a duplicate of this issue. ***
Comment #5 by github-bugzilla — 2014-03-14T01:03:33Z
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
Comment #6 by k.hara.pg — 2014-07-15T05:39:14Z
*** Issue 13079 has been marked as a duplicate of this issue. ***