[Issue 10943] Nested lambda alias in template arguments has no code generated

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Thu Apr 16 15:34:02 PDT 2015


https://issues.dlang.org/show_bug.cgi?id=10943

Justin Whear <justin at economicmodeling.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |justin at economicmodeling.com

--- Comment #1 from Justin Whear <justin at economicmodeling.com> ---
This bug is still present in 2.067.0 and is blocking some useful code from
being developed.  Here's another repro:

-----
template Job(alias w){ alias work = w; }
template doAll(Jobs...)
{
    import std.typetuple;
    alias jobs = staticMap!(Job, Jobs);
    void doAll()
    {
        foreach (job; jobs)
            job.work();
    }
}

import std.stdio;
void main(string[] args)
{
    doAll!({ writeln("1"); });
}
-----

$ dmd bug_10943.d
bug_10943.o: In function
`_D9bug_1094351__T5doAllS38_D9bug_109434mainFAAyaZ9__lambda2FNfZvZ5doAllFNfZv':
bug_10943.d:(.text._D9bug_1094351__T5doAllS38_D9bug_109434mainFAAyaZ9__lambda2FNfZvZ5doAllFNfZv+0x5):
undefined reference to `_D9bug_109434mainFAAyaZ9__lambda2FNfZv'
collect2: error: ld returned 1 exit status
--- errorlevel 1

$ nm bug_10943.o | grep lambda
                 U _D9bug_109434mainFAAyaZ9__lambda2FNfZv
0000000000000000 W
_D9bug_1094351__T5doAllS38_D9bug_109434mainFAAyaZ9__lambda2FNfZvZ5doAllFNfZv

--


More information about the Digitalmars-d-bugs mailing list