Mercurial > projects > dstress
changeset 1096:daa894e9fb12
[Issue 276] Compiler erroneously thinks an aggregate inner template will add a field to it
Bruno Medeiros <daiphoenix@lycos.com>
2006-08-02
news:bug-276-3@http.d.puremagic.com/issues/
author | thomask |
---|---|
date | Mon, 14 Aug 2006 11:37:28 +0000 |
parents | 67d6d7538065 |
children | ba136e21b011 |
files | compile/t/template_41_A.d compile/t/template_41_B.d compile/t/template_41_C.d compile/t/template_41_D.d compile/t/template_41_E.d compile/t/template_41_F.d compile/t/template_41_G.d compile/t/template_41_H.d |
diffstat | 8 files changed, 164 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/template_41_A.d Mon Aug 14 11:37:28 2006 +0000 @@ -0,0 +1,21 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bruno Medeiros <daiphoenix@lycos.com> +// @date@ 2006-08-02 +// @uri@ news:bug-276-3@http.d.puremagic.com/issues/ + +module dstress.compile.t.template_41_A; + +struct S{ + template T1(){ + template T2(int i) { + const int T2 = i + 1; + } + } +} + +alias S.T1!().T2 inc; + +static assert(inc!(2) == 3);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/template_41_B.d Mon Aug 14 11:37:28 2006 +0000 @@ -0,0 +1,21 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bruno Medeiros <daiphoenix@lycos.com> +// @date@ 2006-08-02 +// @uri@ news:bug-276-3@http.d.puremagic.com/issues/ + +module dstress.compile.t.template_41_B; + +class C{ + template T1(){ + template T2(int i) { + const int T2 = i + 1; + } + } +} + +alias C.T1!().T2 inc; + +static assert(inc!(2) == 3);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/template_41_C.d Mon Aug 14 11:37:28 2006 +0000 @@ -0,0 +1,19 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bruno Medeiros <daiphoenix@lycos.com> +// @date@ 2006-08-02 +// @uri@ news:bug-276-3@http.d.puremagic.com/issues/ + +module dstress.compile.t.template_41_C; + +template T1(){ + template T2(int i) { + const int T2 = i + 1; + } +} + +alias T1!().T2 inc; + +static assert(inc!(2) == 3);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/template_41_D.d Mon Aug 14 11:37:28 2006 +0000 @@ -0,0 +1,21 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bruno Medeiros <daiphoenix@lycos.com> +// @date@ 2006-08-02 +// @uri@ news:bug-276-3@http.d.puremagic.com/issues/ + +module dstress.compile.t.template_41_D; + +template T1(){ + template T2() { + template T3(int i){ + const int T3 = i + 1; + } + } +} + +alias T1!().T2!().T3 inc; + +static assert(inc!(2) == 3);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/template_41_E.d Mon Aug 14 11:37:28 2006 +0000 @@ -0,0 +1,21 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bruno Medeiros <daiphoenix@lycos.com> +// @date@ 2006-08-02 +// @uri@ news:bug-276-3@http.d.puremagic.com/issues/ + +module dstress.compile.t.template_41_E; + +struct S{ + template T1(){ + template T2() { + const int T2 = 3; + } + } +} + +alias S.T1!().T2 x; + +static assert(x!() == 3);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/template_41_F.d Mon Aug 14 11:37:28 2006 +0000 @@ -0,0 +1,21 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bruno Medeiros <daiphoenix@lycos.com> +// @date@ 2006-08-02 +// @uri@ news:bug-276-3@http.d.puremagic.com/issues/ + +module dstress.compile.t.template_41_F; + +class C{ + template T1(){ + template T2() { + const int T2 = 3; + } + } +} + +alias C.T1!().T2 x; + +static assert(x!() == 3);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/template_41_G.d Mon Aug 14 11:37:28 2006 +0000 @@ -0,0 +1,19 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bruno Medeiros <daiphoenix@lycos.com> +// @date@ 2006-08-02 +// @uri@ news:bug-276-3@http.d.puremagic.com/issues/ + +module dstress.compile.t.template_41_G; + +template T1(){ + template T2(){ + const int T2 = 3; + } +} + +alias T1!().T2 x; + +static assert(x!() == 3);
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/compile/t/template_41_H.d Mon Aug 14 11:37:28 2006 +0000 @@ -0,0 +1,21 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Bruno Medeiros <daiphoenix@lycos.com> +// @date@ 2006-08-02 +// @uri@ news:bug-276-3@http.d.puremagic.com/issues/ + +module dstress.compile.t.template_41_D; + +template T1(){ + template T2() { + template T3(){ + const int T3 = 3; + } + } +} + +alias T1!().T2!().T3 x; + +static assert(x!() == 3);