Mercurial > projects > dstress
changeset 949:f64573e691f6
<deewiant@gmail.com>
2006-04-04
news:bug-85-3@http.d.puremagic.com/bugzilla/
author | thomask |
---|---|
date | Thu, 06 Apr 2006 07:18:11 +0000 |
parents | a3716859972b |
children | fd579aa6ff7e |
files | run/i/interface_24_A.d run/i/interface_24_B.d run/i/interface_24_C.d run/i/interface_24_D.d |
diffstat | 4 files changed, 192 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/i/interface_24_A.d Thu Apr 06 07:18:11 2006 +0000 @@ -0,0 +1,48 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <deewiant@gmail.com> +// @date@ 2006-04-04 +// @uri@ news:bug-85-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.i.interface_24_A; + +interface I { + I[] foo(); + int x(); +} + +class Class : I { + I[] foo() { + Class[] f = new Class[1]; + f[0] = new Class(); + return f; + } + + int x() { + return 1; + } +} + +int main() { + Class c = new Class(); + I i = c; + + if(c.x() != 1){ + assert(0); + } + + if(i.x() != 1){ + assert(0); + } + + I[] ii = c.foo(); + i = ii[0]; + + if(i.x() != 1){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/i/interface_24_B.d Thu Apr 06 07:18:11 2006 +0000 @@ -0,0 +1,48 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <deewiant@gmail.com> +// @date@ 2006-04-04 +// @uri@ news:bug-85-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.i.interface_24_B; + +interface I { + I[] foo(); + int x(); +} + +class Class : I { + I[] foo() { + I[] f = new Class[1]; + f[0] = new Class(); + return f; + } + + int x() { + return 1; + } +} + +int main() { + Class c = new Class(); + I i = c; + + if(c.x() != 1){ + assert(0); + } + + if(i.x() != 1){ + assert(0); + } + + I[] ii = c.foo(); + i = ii[0]; + + if(i.x() != 1){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/i/interface_24_C.d Thu Apr 06 07:18:11 2006 +0000 @@ -0,0 +1,48 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <deewiant@gmail.com> +// @date@ 2006-04-04 +// @uri@ news:bug-85-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.i.interface_24_C; + +interface I { + I[] foo(); + int x(); +} + +class Class : I { + I[] foo() { + Class[] f; + f ~= new Class(); + return f; + } + + int x() { + return 1; + } +} + +int main() { + Class c = new Class(); + I i = c; + + if(c.x() != 1){ + assert(0); + } + + if(i.x() != 1){ + assert(0); + } + + I[] ii = c.foo(); + i = ii[0]; + + if(i.x() != 1){ + assert(0); + } + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/i/interface_24_D.d Thu Apr 06 07:18:11 2006 +0000 @@ -0,0 +1,48 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ <deewiant@gmail.com> +// @date@ 2006-04-04 +// @uri@ news:bug-85-3@http.d.puremagic.com/bugzilla/ + +module dstress.run.i.interface_24_D; + +interface I { + I[] foo(); + int x(); +} + +class Class : I { + I[] foo() { + I[] f; + f ~= new Class(); + return f; + } + + int x() { + return 1; + } +} + +int main() { + Class c = new Class(); + I i = c; + + if(c.x() != 1){ + assert(0); + } + + if(i.x() != 1){ + assert(0); + } + + I[] ii = c.foo(); + i = ii[0]; + + if(i.x() != 1){ + assert(0); + } + + return 0; +}