www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10943] New: Nested lambda alias in template arguments has no code generated

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

           Summary: Nested lambda alias in template arguments has no code
                    generated
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: kirsybuu gmail.com


--- Comment #0 from kirsybuu gmail.com 2013-09-01 14:41:11 PDT ---
struct LambWrap(alias f) {
    alias F = f;
}
struct LinkBug(S) {
    int method() { return S.F(); }
}
void main() {
    LinkBug!( LambWrap!( () => 4 ) ) w;
}

//////////////////////////////////////////////////////////

Breaks in dmd version 2.063.2 (and in current v2.064-devel):

$ uname -r -s -v
Linux 3.5.0-28-generic #48-Ubuntu SMP Tue Apr 23 23:03:38 UTC 2013

$ dmd -v lambdalink.d 
binary    dmd
version   v2.063
config    /etc/dmd.conf
parse     lambdalink
importall lambdalink
import    object    (/usr/include/dmd/druntime/import/object.di)
semantic  lambdalink
entry     main          lambdalink.d
semantic2 lambdalink
semantic3 lambdalink
code      lambdalink
function  D main
function  lambdalink.LinkBug!(LambWrap!(function int()
{
return 4;
}
)).LinkBug.method
gcc lambdalink.o -o lambdalink -m64 -L/usr/lib/x86_64-linux-gnu
-L/usr/lib/i386-linux-gnu -Xlinker --no-warn-search-mismatch -Xlinker
--export-dynamic -l:libphobos2.a -lpthread -lm -lrt 
lambdalink.o: In function
`_D10lambdalink94__T7LinkBugTS10lambdalink57__T8LambWrapS41_D10lambdalink4mainFZv9__lambda1FNaNbNfZiZ8LambWrapZ7LinkBug6methodMFNaNbNfZi':
lambdalink.d:(.text._D10lambdalink94__T7LinkBugTS10lambdalink57__T8LambWrapS41_D10lambdalink4mainFZv9__lambda1FNaNbNfZiZ8LambWrapZ7LinkBug6methodMFNaNbNfZi+0x49):
undefined reference to `_D10lambdalink4mainFZv9__lambda1FNaNbNfZi'
collect2: error: ld returned 1 exit status
--- errorlevel 1

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