Mercurial > projects > dstress
changeset 1072:4ad1807b13a3
<oskar.linde@gmail.com>
2006-07-06
news:bug-241-3@http.d.puremagic.com/issues/
author | thomask |
---|---|
date | Fri, 07 Jul 2006 16:52:52 +0000 |
parents | f9084d3862e8 |
children | 6c7318abb97c |
files | run/b/bug_template_622_A.d run/b/bug_template_622_B.d run/b/bug_template_622_C.d |
diffstat | 3 files changed, 69 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/b/bug_template_622_A.d Fri Jul 07 16:52:52 2006 +0000 @@ -0,0 +1,23 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <oskar.linde@gmail.com> +// @date@ 2006-07-06 +// @uri@ news:bug-241-3@http.d.puremagic.com/issues/ + +module dstress.run.b.bug_template_622_A; + +template func(T, T c = 1){ + T func(T x){ + return x + c; + } +} + +int main(){ + if(func(1) != 2){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/b/bug_template_622_B.d Fri Jul 07 16:52:52 2006 +0000 @@ -0,0 +1,23 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <oskar.linde@gmail.com> +// @date@ 2006-07-06 +// @uri@ news:bug-241-3@http.d.puremagic.com/issues/ + +module dstress.run.b.bug_template_622_B; + +template func(T, T c = 1){ + T func(T x){ + return x + c; + } +} + +int main(){ + if(func!(int)(1) != 2){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/b/bug_template_622_C.d Fri Jul 07 16:52:52 2006 +0000 @@ -0,0 +1,23 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <oskar.linde@gmail.com> +// @date@ 2006-07-06 +// @uri@ news:bug-241-3@http.d.puremagic.com/issues/ + +module dstress.run.b.bug_template_622_C; + +template func(T, T c = 1){ + T func(T x){ + return x + c; + } +} + +int main(){ + if(func!(int, 2)(1) != 3){ + assert(0); + } + + return 0; +}