view run/destructor_04.d @ 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
children 9a121126b077
line wrap: on
line source

// $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;
}