view run/bug_20050128_B.d @ 1330:f3f715978184

Georg Wrede <georg@iki.fi> 2007-01-07 mail:45A120F5.1050108@iki.fi
author thomask
date Sat, 13 Jan 2007 10:33:49 +0000
parents e77e4444c170
children 52c9e86b6486
line wrap: on
line source

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

// @author@	Nick <Nick_member@pathlink.com>
// @date@	2005-01-28
// @uri@	news:ctdtgj$30r$1@digitaldaemon.com
// @url@	nntp://news.digitalmars.com/digitalmars.D.bugs/2784

module dstress.run.bug_20050128_B;

struct MyStruct{
	int i;
     
	void display(){
		assert(i==10);
	}
    
	void someFunc(){
		// We never call this function
		void bug(MyStruct[] array){
			// array[0].i = i+1; // Comment out this line and the bug goes away
		}
    
		assert(i==10);
		display();
		assert(i==10);
	}
}
    
int main(){
	MyStruct m;
	m.i = 10;
	assert(m.i==10);
	m.someFunc();
	assert(m.i==10);
	return 0;
}