[Issue 10350] New: Valid code cannot be compiled with "-inline"

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 12 23:42:55 PDT 2013


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

           Summary: Valid code cannot be compiled with "-inline"
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: fengli at gmail.com


--- Comment #0 from fengli at gmail.com 2013-06-12 23:42:53 PDT ---
The following code compiles fine with the command "dmd test.d"

import std.array, std.algorithm, std.algorithm, std.string;
void main()
{
    int[string] s;
    auto a = join(map!(a=>format("%s %d", a, s[a]))(s.keys));
}

However, if I try to compile it with "dmd -inline test.d", I get 
this error message:

test.d(5): Error: function D main is a nested function and cannot 
be accessed from std.array.join!(MapResult!(__lambda2, 
string[])).join

The above test was performed with DMD 2.063 on OSX.

-- 
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