[Issue 9578] New: "is a nested function and cannot be accessed from" problem
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Feb 23 09:51:21 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9578
Summary: "is a nested function and cannot be accessed from"
problem
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Keywords: rejects-valid
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: verylonglogin.reg at gmail.com
--- Comment #0 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2013-02-23 20:51:20 MSK ---
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.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list