Thread overview
Compiler hangs on recursive template
Jun 10, 2005
Nick
Jun 11, 2005
Walter
Jun 11, 2005
Thomas Kuehne
June 10, 2005
DMD hangs when trying to compile the following:

template AA(int i) {
class A : AA!(i+1).A {}
}
alias AA!(0).A A0;

If you add something that stops the recursion somehow, for example

template AA(int i : 20)
{class A {}}

then it works as expected. I'm using 0.126 on linux.

Nick


June 11, 2005
Weeelll, it eventually will fail with a stack fault. It just takes a long time.


June 11, 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Nick schrieb am Fri, 10 Jun 2005 11:30:02 +0000 (UTC):
> DMD hangs when trying to compile the following:
>
> template AA(int i) {
> class A : AA!(i+1).A {}
> }
> alias AA!(0).A A0;
>
> If you add something that stops the recursion somehow, for example
>
> template AA(int i : 20)
> {class A {}}
>
> then it works as expected. I'm using 0.126 on linux.

Added to DStress as http://dstress.kuehne.cn/nocompile/t/template_16.d http://dstress.kuehne.cn/nocompile/t/template_class_09.d

Thomas


-----BEGIN PGP SIGNATURE-----

iD8DBQFCqoNn3w+/yD4P9tIRAhr+AJ9rLyXxhMjgESLACEeEtY/C6jwoJwCfclV+
xZ65YRJ03oKc2IhClPz4wOA=
=95Q3
-----END PGP SIGNATURE-----