D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 5160 - Overzealous recursive template expansion protection.
Summary: Overzealous recursive template expansion protection.
Status: RESOLVED WORKSFORME
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 Linux
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-03 14:54 UTC by Gareth Charnock
Modified: 2014-03-19 04:09 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Gareth Charnock 2010-11-03 14:54:17 UTC
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)
Comment 1 Infiltrator 2014-03-19 04:09:21 UTC
This compiles without errors with v2.065.