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 by lt.infiltrator — 2014-03-19T04:09:21Z