www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - dmd crash with templates

This crashes DMD 0.92 - WIN32  

template foo(Type, alias Func)
{
int foo(Type t)
{
return Func(t);
}
}

template foo(Type)
{
int foo(Type t)
{
static int f(Type a)
{
return a;
}

return foo!(Type, f)(t);
}
}

int main(char[][] argv)
{
printf("%d\n",foo!(int)(1));

return 0;
}
Jun 19 2004