www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1825] New: local instantiation and function nesting

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1825

           Summary: local instantiation and function nesting
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: bugzilla digitalmars.com


The following should compile, as fun1 can be instantiated within fun2.

import std.stdio;

void fun1(alias pred1, alias pred2)()
{
    pred1(1);
    pred2(2);
}

void fun2(alias pred1)()
{
    void local(int x) { writeln("fun2.local: ", x); }
    fun1!(pred1, local)();
}

void main()
{
    void local(int x) { writeln("main.local: ", x); }
    fun2!(local)();
}


-- 
Feb 09 2008
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1825


bugzilla digitalmars.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED




------- Comment #1 from bugzilla digitalmars.com  2008-02-28 22:42 -------
Fixed dmd 1.027 and 2.011


-- 
Feb 28 2008