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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 11 06:35:34 PDT 2013


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


Joseph Rushton Wakeling <joseph.wakeling at webdrake.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |joseph.wakeling at webdrake.ne
                   |                            |t


--- Comment #1 from Joseph Rushton Wakeling <joseph.wakeling at webdrake.net> 2013-07-11 06:35:32 PDT ---
Interesting -- I have a similar problem when compiling a program using
schwartzSort with the -debug flag:

import std.algorithm, std.range;
void main()
{
        size_t[] x = [4, 9, 3, 2, 1, 10, 8, 5, 7, 6];
        size_t[] i = iota(x.length).array;
        schwartzSort!(a => x[a], "a < b")(i);
}

This compiles fine with dmd -inline but generates a similar error message when
dmd -debug is used:

/opt/dmd/include/d2/std/algorithm.d(9117): Error: delegate
schwartz.main.__lambda2!ulong.__lambda2 is a nested function and cannot be
accessed from schwartz.main.schwartzSort!(__lambda2, "a < b",
cast(SwapStrategy)0, ulong[]).__lambda1621!(ulong, ulong).__lambda1621
/opt/dmd/include/d2/std/algorithm.d(9117): Error: delegate
schwartz.main.__lambda2!ulong.__lambda2 is a nested function and cannot be
accessed from schwartz.main.schwartzSort!(__lambda2, "a < b",
cast(SwapStrategy)0, ulong[]).__lambda1621!(ulong, ulong).__lambda1621

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