view run/t/typedef_13_A.d @ 906:bc3c8ee485f5

<jarrett.billingsley@gmail.com> 2006-03-11 news:bug-36-3@http.d.puremagic.com/bugzilla/
author thomask
date Mon, 13 Mar 2006 08:12:04 +0000
parents
children 81222734adf3
line wrap: on
line source

// $HeadURL$
// $Date$
// $Author$

// @author@	<jarrett.billingsley@gmail.com>
// @date@	2006-03-11
// @uri@	news:bug-36-3@http.d.puremagic.com/bugzilla/

module dstress.run.t.typedef_13_A;

bool status = false;

enum Enum {
        ONE = 1,
	TWO,
	THREE
}

class A {
	typedef void delegate(Enum) EnumDG;
	
	void fork(EnumDG dg){
		dg(Enum.TWO);
	}
	
	void test(Enum e){
		if(e != Enum.TWO){
			assert(0);
		}
		status = true;
	}
}

int main(){
	if(status){
		assert(0);
	}

	A a = new A();
	a.fork(&a.test);

	if(!status){
		assert(0);
	}

	return 0;
}