Bug 9578 – "is a nested function and cannot be accessed from" problem

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-02-23T09:51:00Z
Last change time
2013-07-13T08:57:46Z
Keywords
rejects-valid
Assigned to
nobody
Creator
verylonglogin.reg

Comments

Comment #0 by verylonglogin.reg — 2013-02-23T09:51:20Z
The following code compiles fine if `t.tf` is not templated: --- template t(alias f) { void tf()() { f(); } } void g(alias f)() { f(); // Error: function main.h.t!(m).tf!().tf is a nested function and cannot be accessed from main.g!(tf).g } void h() { int i = 0; int m() { return i; } g!(t!m.tf)(); } --- As a result `std.functional.not` and `std.algorithm.all` (as it uses `not`) don't work for nested predicates. Also see Issue 8693.
Comment #1 by verylonglogin.reg — 2013-02-27T06:01:42Z
Issue workaround to `std.algorithm.all`: https://github.com/D-Programming-Language/phobos/pull/1178
Comment #2 by github-bugzilla — 2013-03-06T22:15:42Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/b5ca2ef0c9742c89a587d476848e0f34df2a4f9e Add Issue 9578 workaround to `std.algorithm.all` As a result `all` can now be used with nested predicates. Issue URL: http://d.puremagic.com/issues/show_bug.cgi?id=9578 https://github.com/D-Programming-Language/phobos/commit/8dbfc1a7382792e039c8f1d7f5f5232279dead04 Merge pull request #1178 from denis-sh/add-Issue-9578-workaround-to-`std.algorithm.all` Add Issue 9578 workaround to `std.algorithm.all`
Comment #3 by github-bugzilla — 2013-07-09T23:36:31Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/98a398b704001b0bb1fd0259e5687dab11e88cce fix Issue 9578 - "is a nested function and cannot be accessed from" problem https://github.com/D-Programming-Language/dmd/commit/e66cc8f5787154bc0225246e2c49c84842727d05 Merge pull request #2330 from 9rnsr/fix9578 Issue 9578 - "is a nested function and cannot be accessed from" problem
Comment #4 by github-bugzilla — 2013-07-13T08:57:46Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/05538fe8fc62333b59a06fd0c03c5b9d4a6b47ae Remove bug 9578 workaround Because the compiler bug was fixed recently. --- Revert "Merge pull request #1178 from denis-sh/add-Issue-9578-workaround-to-`std.algorithm.all`" This reverts commit 8dbfc1a7382792e039c8f1d7f5f5232279dead04, reversing changes made to 93c724f2a36a798985dc1d82b050899455c8de4c. https://github.com/D-Programming-Language/phobos/commit/0478579e89e6e2ee8b0f7b2027c3464177867fd0 Merge pull request #1406 from 9rnsr/remove9578wa Remove bug 9578 workaround