view run/s/scope_18_B.d @ 1460:d0ab95b04926

[Issue 815] scope(exit) isn't executed when "continue" is used to continue a while-loop Thomas K?hne <thomas-dloop@kuehne.cn> 2007-01-07 http://d.puremagic.com/issues/show_bug.cgi?id=815
author thomask
date Thu, 05 Apr 2007 10:28:19 +0000
parents
children
line wrap: on
line source

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

// @author@	Thomas Kühne <thomas-dloop@kuehne.cn>
// @date@	2007-01-07
// @uri@	http://d.puremagic.com/issues/show_bug.cgi?id=815
// @desc@	[Issue 815] scope(exit) isn't executed when "continue" is used to continue a while-loop

module dstress.run.s.scope_18_B;

int main(){
	int[] log;
	int i = 3;

	while(i--){
		scope(success){
			log ~= 0xEE;
		}
		log ~= i;
		
		if(i % 2){
			continue;
		}
		log ~= 0xFF;
	}

	if([2, 0xFF, 0xEE, 1, 0xEE, 0, 0xFF, 0xEE] != log){
		assert(0);
	}

	return 0;
}