http://d.puremagic.com/issues/show_bug.cgi?id=9996

           Summary: Outer variable in nested function cannot be accessed.
                    (-inline)
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: [email protected]
        ReportedBy: [email protected]


--- Comment #0 from Christian Schneider <[email protected]> 2013-04-26 09:56:17 PDT 
---
DMD 2.062, x86/Linux

test.d:
------------------------------------------------------------
import std.algorithm;
import std.array;
import std.string;

string[] arr = ["param"];

void main()
{
  bool b;
  string i(string n) { return n ~ (b ? "b" : "a"); }
  arr.map!i().join(", ");
}
------------------------------------------------------------
dmd -inline test.d
------------------------------------------------------------
test.d(10): Error: function D main is a nested function and cannot be accessed
from std.array.join!(MapResult!(i, string[]), string).join
test.d(10): Error: function D main is a nested function and cannot be accessed
from std.array.join!(MapResult!(i, string[]), string).join
test.d(10): Error: function D main is a nested function and cannot be accessed
from std.array.join!(MapResult!(i, string[]), string).join

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to