view run/t/template_32_U.d @ 1564:1d41f2132ef4

r8717@birke: tk | 2007-09-30 10:45:56 +0200 [Issue 1532] Template instance cannot use class locals as template parameters <samukha@voliacable.com> 2007-09-07 http://d.puremagic.com/issues/show_bug.cgi?id=1532
author thomask
date Sun, 30 Sep 2007 09:46:24 +0000
parents 902d2c168029
children
line wrap: on
line source

// $HeadUR$
// $Date$
// $Author$

// @author@	Dave <Dave_member@pathlink.com>
// @date@	2006-03-18
// @uri@	news:dvgq34$22hv$1@digitaldaemon.com
// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=487

module dstress.run.t.template_32_U;

template sum(ireal x){
	static if (x <= 1.0Li){
		const ireal sum = x;
	}else{
		const ireal sum = x + sum!(x - 1.0Li);
	}
}

int main(){
	ireal x = sum!(1.0Li);

	if(x != 1.0Li){
		assert(0);
	}

	return 0;
}