Mercurial > projects > dstress
changeset 828:083e64ed4dad
Jarrett Billingsley <kb3ctd2@yahoo.com>
2006-02-07
news:dsbrc6$lj7$1@digitaldaemon.com
author | thomask |
---|---|
date | Sun, 12 Feb 2006 08:21:58 +0000 |
parents | 56513beba199 |
children | 31e288138e9d |
files | run/p/private_11_A.d run/p/private_11_B.d run/p/private_11_C.d |
diffstat | 3 files changed, 103 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/p/private_11_A.d Sun Feb 12 08:21:58 2006 +0000 @@ -0,0 +1,33 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Jarrett Billingsley <kb3ctd2@yahoo.com> +// @date@ 2006-02-07 +// @uri@ news:dsbrc6$lj7$1@digitaldaemon.com + +module dstress.run.p.private_11_A; + +class A{ + private int x; +} + +class Wrapper{ + static class B{ + int test(A other){ + return other.x; + } + } +} + +int main(){ + A a = new A(); + Wrapper.B b = new Wrapper.B(); + + assert(b.test(a) == 0); + + a.x = 3; + assert(b.test(a) == 3); + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/p/private_11_B.d Sun Feb 12 08:21:58 2006 +0000 @@ -0,0 +1,39 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Jarrett Billingsley <kb3ctd2@yahoo.com> +// @date@ 2006-02-07 +// @uri@ news:dsbrc6$lj7$1@digitaldaemon.com + +module dstress.run.p.private_11_B; + +class A{ + private int x; +} + +class Wrapper{ + class B{ + int test(A other){ + return other.x; + } + } + + void test(){ + A a = new A(); + B b = new B(); + + assert(b.test(a) == 0); + + a.x = 3; + assert(b.test(a) == 3); + } +} + +int main(){ + Wrapper w = new Wrapper(); + + w.test(); + + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/p/private_11_C.d Sun Feb 12 08:21:58 2006 +0000 @@ -0,0 +1,31 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Jarrett Billingsley <kb3ctd2@yahoo.com> +// @date@ 2006-02-07 +// @uri@ news:dsbrc6$lj7$1@digitaldaemon.com + +module dstress.run.p.private_11_C; + +class A{ + private int x; +} + +class B{ + int test(A other){ + return other.x; + } +} + +int main(){ + A a = new A(); + B b = new B(); + + assert(b.test(a) == 0); + + a.x = 3; + assert(b.test(a) == 3); + + return 0; +}