compiler assertion

Zhenya zheny at list.ru
Fri Sep 28 13:19:56 PDT 2012


Hi!
Is it normally,that this simple code does'nt compile with this 
assertion:
dmd: template.c:5542: Identifier* 
TemplateInstance::genIdent(Objects*): Assertion `global.errors' 
failed.

import std.stdio;
import std.typetuple;

template sum(T:TypeTuple!U,U...)
{
	static if(U.length == 0)
		enum sum = 0;
	else
		enum sum = U[0]+sum!(U[1..$]);
}

void main()
{
	enum s = sum!(1,2,3,4);
	writeln(s);
}

?



More information about the Digitalmars-d-learn mailing list