[Issue 4841] New: An array()/map inlining problem
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Sep 8 04:08:23 PDT 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4841
Summary: An array()/map inlining problem
Product: D
Version: D2
Platform: x86
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 2010-09-08 04:08:00 PDT ---
This is a D2 program:
import std.algorithm: map;
import std.array: array;
void main() {
int c;
array(map!((x){return c;})([1]));
}
It works if you compile it with dmd 2.048 with:
dmd test.d
But if use inlining:
dmd -inline test.d
It doesn't compile and dmd returns:
test.d(5): Error: function D main is a nested function and cannot be accessed
from array
I think this is a compiler bug because inlining should not affect the
compilability of a program.
--
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