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


This is related to issue #1742.  In the code below, calling proc_!(char).fn
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




------- Comment #1 from samukha voliacable.com  2008-11-13 01:22 -------
Works with dmd 2.020


-- 
Nov 12 2008