Mercurial > projects > dstress
changeset 1121:48006b92f2b7
[Issue 296] New: Template constant can not be used as size of static array.
Oskar Linde <oskar.linde@gmail.com>
2006-08-19
news:bug-296-3@http.d.puremagic.com/issues/
author | thomask |
---|---|
date | Sat, 26 Aug 2006 11:05:13 +0000 |
parents | d374abf09616 |
children | 1430561a2f89 |
files | compile/t/template_43_A.d compile/t/template_43_B.d |
diffstat | 2 files changed, 36 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/template_43_A.d Sat Aug 26 11:05:13 2006 +0000 @@ -0,0 +1,18 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Oskar Linde <oskar.linde@gmail.com> +// @date@ 2006-08-19 +// @uri@ news:bug-296-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 296] New: Template constant can not be used as size of static array. + +module dstress.compile.t.template_43_A; + +template Count(){ + const int Count = 5; +} + +int[Count!()] x; + +static assert(x.length != 5);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/template_43_B.d Sat Aug 26 11:05:13 2006 +0000 @@ -0,0 +1,18 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Oskar Linde <oskar.linde@gmail.com> +// @date@ 2006-08-19 +// @uri@ news:bug-296-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 296] New: Template constant can not be used as size of static array. + +module dstress.compile.t.template_43_B; + +template Count(){ + const int i = 5; +} + +int[Count!().i] x; + +static assert(x.length != 5);