Mercurial > projects > dstress
changeset 269:281520e4cf9e
dtor called after exception in thrown in the ctor
Kevin Bealer <Kevin_member@pathlink.com>
2005-02-05
news:cu1m3r$13b4$1@digitaldaemon.com
author | thomask |
---|---|
date | Sat, 05 Feb 2005 22:53:40 +0000 |
parents | 84270944834c |
children | eaaf448a9ab4 |
files | run/destructor_04.d |
diffstat | 1 files changed, 34 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/destructor_04.d Sat Feb 05 22:53:40 2005 +0000 @@ -0,0 +1,34 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ Kevin Bealer <Kevin_member@pathlink.com> +// @date@ 2005-02-05 +// @uri@ news:cu1m3r$13b4$1@digitaldaemon.com + +module dstress.run.destructor_04; + +class MyClass{ + this(){ + throw new Exception("dummy"); + } + + ~this(){ + assert(0); + } +} + +int main(){ + MyClass c; + + bool caught=false; + try{ + c = new MyClass(); + }catch{ + caught=true; + } + + assert(caught); + + return 0; +}