Mercurial > projects > dstress
changeset 232:2ffaa0006877
downcasting classes not an lvalue
Jarrett Billingsley <kb3ctd2@yahoo.com>
2005-01-09
news:crshla$2io3$1@digitaldaemon.com
nntp://news.digitalmars.com/digitalmars.D.bugs/2659
author | thomask |
---|---|
date | Tue, 11 Jan 2005 03:58:28 +0000 |
parents | a332eed5d52c |
children | 4f2cada445c3 |
files | run/cast_08.d run/cast_09.d run/cast_10.d |
diffstat | 3 files changed, 70 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/cast_08.d Tue Jan 11 03:58:28 2005 +0000 @@ -0,0 +1,23 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Jarrett Billingsley <kb3ctd2@yahoo.com> +// @date@ 2005-01-09 +// @uri@ news:crshla$2io3$1@digitaldaemon.com +// @url@ nntp://news.digitalmars.com/digitalmars.D.bugs/2659 + +module dstress.run.cast_08; + +class Parent{ +} + +class Child{ +} + +int main(){ + Child c = new Child(); + Parent p = cast(Parent) c; + p = null; + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/cast_09.d Tue Jan 11 03:58:28 2005 +0000 @@ -0,0 +1,22 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Jarrett Billingsley <kb3ctd2@yahoo.com> +// @date@ 2005-01-09 +// @uri@ news:crshla$2io3$1@digitaldaemon.com +// @url@ nntp://news.digitalmars.com/digitalmars.D.bugs/2659 + +module dstress.run.cast_09; + +class Parent{ +} + +class Child{ +} + +int main(){ + Child c = new Child(); + cast(Parent) p=null; + return 0; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/cast_10.d Tue Jan 11 03:58:28 2005 +0000 @@ -0,0 +1,25 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Jarrett Billingsley <kb3ctd2@yahoo.com> +// @date@ 2005-01-09 +// @uri@ news:crshla$2io3$1@digitaldaemon.com +// @url@ nntp://news.digitalmars.com/digitalmars.D.bugs/2659 + +module dstress.run.cast_10; + +class Parent{ +} + +class Child{ +} + +void test(inout Parent p){ +} + +int main(){ + Child c = new Child(); + test(c); + return 0; +}