http://d.puremagic.com/issues/show_bug.cgi?id=7559
Summary: Nested function error without -inline
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Keywords: rejects-valid
Severity: major
Priority: P2
Component: DMD
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 2012-02-21 14:16:16 PST ---
This may be related to Issue 4841. But here the inaccessible nested function
error appears even without "-inline", so maybe the causes are different:
import std.algorithm: all;
bool isOdd(int x) { return x % 2 != 0; }
void main() {
auto data = [1, 3, 5];
assert(all!isOdd(data)); // OK
assert(all!(x => x % 2)(data)); // error
}
DMD 2.059head gives:
...\dmd2\src\phobos\std\functional.d(279): Error: function
test.main.not!(__lambda2).not!(int).not is a nested function and cannot be
accessed from std.algorithm.find!(not,int[]).find
I'd also like to receive an error in my program code, at line 6.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------