Mercurial > projects > dstress
changeset 1136:6d49ea394165
typedef, implicit cast, bug or feature?
Anders Runesson <anders@runesson.info>
2006-07-16
news:1153058426.5844.3.camel@localhost
author | thomask |
---|---|
date | Thu, 14 Sep 2006 07:15:49 +0000 |
parents | 2b58889c7d7e |
children | 679105b449a6 |
files | reporter.txt run/t/typedef_19_A.d run/t/typedef_19_B.d run/t/typedef_19_C.d run/t/typedef_19_D.d |
diffstat | 5 files changed, 126 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/reporter.txt Thu Sep 14 07:15:39 2006 +0000 +++ b/reporter.txt Thu Sep 14 07:15:49 2006 +0000 @@ -6,6 +6,7 @@ Aleksey Bobnev <uw@front.ru> Alex <CppCoder@gmail.com> Anders F Björklun <afb@algonet.se> +Anders Runesson <anders@runesson.info> Andrew Fedoniouk <news@terrainformatica.com> Andy Friesen <andy@ikagames.com> Ant <duitoolkit@yahoo.ca> @@ -111,6 +112,7 @@ Sebastian Beschke <s.beschke@gmx.de> shinichiro.h <s31552@mail.ecc.u-tokyo.ac.jp> Simon Buchan +simon hudon Søren J. Løvborg <web@kwi.dk> Stephan Bergmann <stephan.bergmann@sun.com> Stephan Wienczny <Stephan@Wienczny.de>, <wienczny@web.de>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/typedef_19_A.d Thu Sep 14 07:15:49 2006 +0000 @@ -0,0 +1,34 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Anders Runesson <anders@runesson.info> +// @date@ 2006-07-16 +// @uri@ news:1153058426.5844.3.camel@localhost +// @desc@ typedef, implicit cast, bug or feature? + +module dstress.run.t.typedef_19_A; + +class A{ + int func(int i){ + return i + 1; + } +} + +typedef A B; + +class C : B{ + override int func(int i){ + return super.func(i) * 2; + } +} + +int main(){ + C c = new C(); + + if(c.func(2) != 6){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/typedef_19_B.d Thu Sep 14 07:15:49 2006 +0000 @@ -0,0 +1,34 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Anders Runesson <anders@runesson.info> +// @date@ 2006-07-16 +// @uri@ news:1153058426.5844.3.camel@localhost +// @desc@ typedef, implicit cast, bug or feature? + +module dstress.run.t.typedef_19_B; + +class A{ + int func(int i){ + return i + 1; + } +} + +typedef A B; + +class C : B{ + override int func(int i){ + return A.func(i) * 2; + } +} + +int main(){ + C c = new C(); + + if(c.func(2) != 6){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/typedef_19_C.d Thu Sep 14 07:15:49 2006 +0000 @@ -0,0 +1,28 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Anders Runesson <anders@runesson.info> +// @date@ 2006-07-16 +// @uri@ news:1153058426.5844.3.camel@localhost +// @desc@ typedef, implicit cast, bug or feature? + +module dstress.run.t.typedef_19_C; + +class A{ + int func(int i){ + return i + 1; + } +} + +typedef A B; + +int main(){ + B b = new B(); + + if(b.func(2) != 3){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/t/typedef_19_D.d Thu Sep 14 07:15:49 2006 +0000 @@ -0,0 +1,28 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Anders Runesson <anders@runesson.info> +// @date@ 2006-07-16 +// @uri@ news:1153058426.5844.3.camel@localhost +// @desc@ typedef, implicit cast, bug or feature? + +module dstress.run.t.typedef_19_D; + +class A{ + int func(int i){ + return i + 1; + } +} + +alias A B; + +int main(){ + B b = new B(); + + if(b.func(2) != 3){ + assert(0); + } + + return 0; +}