view run/d/delegate_19_A.d @ 1320:daef239f37cf

sed'ed replacement of new:...http.d.puremagic.com/issues/ with http://d.puremagic.com/issues/show_bug.cgi?...
author thomask
date Sun, 31 Dec 2006 19:59:08 +0000
parents 48fc88ca588a
children
line wrap: on
line source

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

// @author@	<someidiot@earthlink.net>
// @date@	2006-08-23
// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=306
// @desc@	[Issue 306] New: dmd 165 breaks existing code

module dstress.run.d.delegate_19_A;

int status;

void append (char[] content){
	status++;
}

void append (char[] delegate() dg){
	status--;
}

int main(){
	char[] s = "abc";
	
	char[] dummy(){
		return "123";
	}

	append(s);
	if(status != 1){
		assert(0);
	}

	append(dummy);
	if(status != 2){
		assert(0);
	}

	append(&dummy);
	if(status != 1){
		assert(0);
	}
	
	append(dummy());
	if(status != 2){
		assert(0);
	}

	return 0;
}