Mercurial > projects > dstress
changeset 1231:5c578f77e01b
[Issue 572] New: syntax error when using template instantiation with typeof
Nazo Humei <lovesyao@hotmail.com>
2006-11-19
news:bug-572-3@http.d.puremagic.com/issues/
author | thomask |
---|---|
date | Sat, 25 Nov 2006 13:37:36 +0000 |
parents | a3b2e2daf68e |
children | 23e380f68232 |
files | compile/t/typeof_15_A.d compile/t/typeof_15_B.d compile/t/typeof_15_C.d |
diffstat | 3 files changed, 62 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/typeof_15_A.d Sat Nov 25 13:37:36 2006 +0000 @@ -0,0 +1,21 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nazo Humei <lovesyao@hotmail.com> +// @date@ 2006-11-19 +// @uri@ news:bug-572-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 572] New: syntax error when using template instantiation with typeof + +module dstress.compile.t.typeof_15_A; + +class Test{ + static template T(){ + const int T = 2; + } +} + +Test o; + +static assert(typeof(o).T!() == 2); +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/typeof_15_B.d Sat Nov 25 13:37:36 2006 +0000 @@ -0,0 +1,19 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nazo Humei <lovesyao@hotmail.com> +// @date@ 2006-11-19 +// @uri@ news:bug-572-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 572] New: syntax error when using template instantiation with typeof + +module dstress.compile.t.typeof_15_B; + +class Test{ + static template T(){ + const int T = 2; + } +} + +static assert(Test.T!() == 2); +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/typeof_15_C.d Sat Nov 25 13:37:36 2006 +0000 @@ -0,0 +1,22 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Nazo Humei <lovesyao@hotmail.com> +// @date@ 2006-11-19 +// @uri@ news:bug-572-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 572] New: syntax error when using template instantiation with typeof + +module dstress.compile.t.typeof_15_C; + +class Test{ + static template T(){ + const int T = 2; + } +} + +Test o; +alias typeof(o) t; + +static assert(t.T!() == 2); +