view run/m/mixin_15_C.d @ 1562:539ede0215a4

r8715@birke: tk | 2007-09-29 23:52:45 +0200 [Issue 1534] Can't mix in a case statement. <aziz.kerim@gmail.com> 2007-09-26 http://d.puremagic.com/issues/show_bug.cgi?id=1534
author thomask
date Sun, 30 Sep 2007 09:44:14 +0000
parents 902d2c168029
children
line wrap: on
line source

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

// @author@	John C <johnch_atms@hotmail.com>
// @date@	2006-01-24
// @uri@	news:dr4t3d$1f24$1@digitaldaemon.com
// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=712

module dstress.run.m.mixin_15_C;

int status;

template T(){
	void test(){
		status += 2;
	}
}

interface I{
	void test();
}

class C : I{
	mixin T!();

	void test(){
		status -= 1;
	}
}

mixin T!();

int main(){
	I i = new C();

	if(status != 0){
		assert(0);
	}
	i.test();
	if(status != -1){
		assert(0);
	}
	test();
	if(status != 1){
		assert(0);
	}

	return 0;
}