# HG changeset patch # User thomask # Date 1142455571 0 # Node ID 20545aed98f2096d618e5c3535578e8ba6bac894 # Parent 7e37cc332431391812ff203d381b09bfef335d14 Victor Nakoryakov 2006-03-11 news:duukb8$2vvd$1@digitaldaemon.com diff -r 7e37cc332431 -r 20545aed98f2 run/t/template_31_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_31_A.d Wed Mar 15 20:46:11 2006 +0000 @@ -0,0 +1,35 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Victor Nakoryakov +// @date@ 2006-03-11 +// @uri@ news:duukb8$2vvd$1@digitaldaemon.com + +module dstress.run.t.template_31_A; + +template C(T, T x){ + T C(){ + return x; + } +} + +int main(){ + const int a = 3; + + auto b = C!(typeof(a), a)(); + + if(!is(typeof(a) : typeof(b))){ + assert(0); + } + + if(!is(typeof(b) : typeof(a))){ + assert(0); + } + + if(a != b){ + assert(0); + } + + return 0; +} diff -r 7e37cc332431 -r 20545aed98f2 run/t/template_31_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_31_B.d Wed Mar 15 20:46:11 2006 +0000 @@ -0,0 +1,35 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Victor Nakoryakov +// @date@ 2006-03-11 +// @uri@ news:duukb8$2vvd$1@digitaldaemon.com + +module dstress.run.t.template_31_B; + +template C(int x){ + int C(){ + return x; + } +} + +int main(){ + const int a = 3; + + auto b = C!(a)(); + + if(!is(typeof(a) : typeof(b))){ + assert(0); + } + + if(!is(typeof(b) : typeof(a))){ + assert(0); + } + + if(a != b){ + assert(0); + } + + return 0; +} diff -r 7e37cc332431 -r 20545aed98f2 run/t/template_31_C.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_31_C.d Wed Mar 15 20:46:11 2006 +0000 @@ -0,0 +1,35 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Victor Nakoryakov +// @date@ 2006-03-11 +// @uri@ news:duukb8$2vvd$1@digitaldaemon.com + +module dstress.run.t.template_31_C; + +template C(T x, T){ + T C(){ + return x; + } +} + +int main(){ + const int a = 3; + + auto b = C!(a, typeof(a))(); + + if(!is(typeof(a) : typeof(b))){ + assert(0); + } + + if(!is(typeof(b) : typeof(a))){ + assert(0); + } + + if(a != b){ + assert(0); + } + + return 0; +} diff -r 7e37cc332431 -r 20545aed98f2 run/t/template_31_D.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/template_31_D.d Wed Mar 15 20:46:11 2006 +0000 @@ -0,0 +1,35 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Victor Nakoryakov +// @date@ 2006-03-11 +// @uri@ news:duukb8$2vvd$1@digitaldaemon.com + +module dstress.run.t.template_31_D; + +template C(int x, T){ + T C(){ + return x; + } +} + +int main(){ + const int a = 3; + + auto b = C!(a, typeof(a))(); + + if(!is(typeof(a) : typeof(b))){ + assert(0); + } + + if(!is(typeof(b) : typeof(a))){ + assert(0); + } + + if(a != b){ + assert(0); + } + + return 0; +}