www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 5160] New: Overzealous recursive template expansion protection.

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

           Summary: Overzealous recursive template expansion protection.
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: gareth.tpc gmail.com


--- Comment #0 from Gareth Charnock <gareth.tpc gmail.com> 2010-11-03 14:54:17
PDT ---
The following will not compile even though templateFunc is not automatically
instantiated with A (there is no actual danger of a stack overflow).

struct A(T1) {
    void templateFunc(T2)(T2 a) {
         alias A!(typeof(this)) error;
    }
}


void main() {
     A!int a;
     a.templateFunc!int(0);
} 

Error: recursive template expansion for template argument A!(int)

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Nov 03 2010