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