# HG changeset patch # User thomask # Date 1164835207 0 # Node ID eb667a69ce7a28daa69675c0a001c415de2ce113 # Parent bcb1327a0f5dfef92be9c6c3d2eecea451f87132 [Issue 617] New: IFTI doesn't use normal promotion rules for non-template parameters Bill Baxter 2006-11-28 news:bug-617-3@http.d.puremagic.com/issues/ diff -r bcb1327a0f5d -r eb667a69ce7a run/t/template_49_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_49_A.d Wed Nov 29 21:20:07 2006 +0000 @@ -0,0 +1,23 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bill Baxter +// @date@ 2006-11-28 +// @uri@ news:bug-617-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 617] New: IFTI doesn't use normal promotion rules for non-template parameters + +module dstress.run.t.template_49_A; + +template foo(T){ + size_t foo(T s, uint i){ + return s.length + i; + } +} + +int main(){ + if(foo("ab", 5) != 7){ + assert(0); + } + return 0; +} diff -r bcb1327a0f5d -r eb667a69ce7a run/t/template_49_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_49_B.d Wed Nov 29 21:20:07 2006 +0000 @@ -0,0 +1,23 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bill Baxter +// @date@ 2006-11-28 +// @uri@ news:bug-617-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 617] New: IFTI doesn't use normal promotion rules for non-template parameters + +module dstress.run.t.template_49_B; + +template foo(T){ + size_t foo(T s, int i){ + return s.length + i; + } +} + +int main(){ + if(foo("ab", 5) != 7){ + assert(0); + } + return 0; +} diff -r bcb1327a0f5d -r eb667a69ce7a run/t/template_49_C.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_49_C.d Wed Nov 29 21:20:07 2006 +0000 @@ -0,0 +1,23 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bill Baxter +// @date@ 2006-11-28 +// @uri@ news:bug-617-3@http.d.puremagic.com/issues/ +// @desc@ [Issue 617] New: IFTI doesn't use normal promotion rules for non-template parameters + +module dstress.run.t.template_49_C; + +template foo(T){ + size_t foo(T s, uint i){ + return s.length + i; + } +} + +int main(){ + if(foo!(char[])("ab", 5) != 7){ + assert(0); + } + return 0; +}