www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1774] New: CTFE rejects nested template expansion

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

           Summary: CTFE rejects nested template expansion
           Product: D
           Version: 2.009
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla digitalmars.com
        ReportedBy: sean f4.ca



explicitly in the global scope works, but calling it explicitly in a template
function fails.  I would expect both to work.

    template proc_( T )
    {
        size_t fn( in T[] a, in T b )
        {
            return 0;
        }
    }

    template proc( T1, T2 )
    {
        size_t proc( T1 a, T2 b )
        {
            return proc_!(char).fn( a, b );
        }
    }

    const a = proc_!(char).fn( "abcde", 'c' );
    const b = proc( "abcde", 'c' );

    void main()
    {

    }


-- 
Jan 08 2008
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1774


samukha voliacable.com changed:

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





Works with dmd 2.020


-- 
Nov 12 2008