view run/s/struct_27_A.d @ 1597:8b9d4d2f925a

Fix typos in complex tests. See D bug 614.
author Christian Kamm <kamm incasoftware de>
date Tue, 09 Sep 2008 16:53:58 +0200
parents 9084482d7c1e
children
line wrap: on
line source

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

// @author@	Alan Knowles <alan@akbkhome.com>
// @date@	2007-01-12
// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=832
// @desc@	[Issue 832] NRVO: return inside foreach results in junk

module dstress.run.s.struct_27_A;

struct S{
	int i;
	long _forec_nrvo;
}

S first(){
	foreach(element; s){
		if(2 != element.i){
			assert(0);
		}
		return element;
	}
}

S[1] s;

int main(){
	s[0].i = 2;
	if(2 != first().i){
		assert(0);
	}

	return 0;
}