Mercurial > projects > dstress
changeset 1293:744c4ec3e3e3
[Issue 688] Implicit function template match doesn't work for classes
Bill Baxter <wbaxter@gmail.com>
2006-12-14
http://d.puremagic.com/issues/show_bug.cgi?id=688
author | thomask |
---|---|
date | Sat, 30 Dec 2006 15:39:14 +0000 |
parents | 6b1e9ade787e |
children | 8a9ce6778db2 |
files | compile/t/template_53_A.d compile/t/template_53_B.d compile/t/template_53_C.d compile/t/template_53_D.d |
diffstat | 4 files changed, 88 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/template_53_A.d Sat Dec 30 15:39:14 2006 +0000 @@ -0,0 +1,22 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bill Baxter <wbaxter@gmail.com> +// @date@ 2006-12-14 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=688 +// @desc@ [Issue 688] Implicit function template match doesn't work for classes + +module dstress.compile.t.template_53_A; + +class Foo(T) { + T data; +} + +void bar(T)(Foo!(T) f){ +} + +void test(){ + auto x = new Foo!(double); + bar(x); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/template_53_B.d Sat Dec 30 15:39:14 2006 +0000 @@ -0,0 +1,22 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bill Baxter <wbaxter@gmail.com> +// @date@ 2006-12-14 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=688 +// @desc@ [Issue 688] Implicit function template match doesn't work for classes + +module dstress.compile.t.template_53_B; + +class Foo(T) { + T data; +} + +void bar(T)(Foo!(T) f){ +} + +void test(){ + auto x = new Foo!(double); + bar!(double)(x); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/template_53_C.d Sat Dec 30 15:39:14 2006 +0000 @@ -0,0 +1,22 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bill Baxter <wbaxter@gmail.com> +// @date@ 2006-12-14 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=688 +// @desc@ [Issue 688] Implicit function template match doesn't work for classes + +module dstress.compile.t.template_53_C; + +struct Foo(T) { + T data; +} + +void bar(T)(Foo!(T) f){ +} + +void test(){ + Foo!(double) x; + bar!(double)(x); +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/template_53_D.d Sat Dec 30 15:39:14 2006 +0000 @@ -0,0 +1,22 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bill Baxter <wbaxter@gmail.com> +// @date@ 2006-12-14 +// @uri@ http://d.puremagic.com/issues/show_bug.cgi?id=688 +// @desc@ [Issue 688] Implicit function template match doesn't work for classes + +module dstress.compile.t.template_53_D; + +struct Foo(T) { + T data; +} + +void bar(T)(Foo!(T) f){ +} + +void test(){ + Foo!(double) x; + bar(x); +}