module checkLocalDefinitionsComeFirst {
	//the good ones
	function f_sample0() {
		var integer a;
		var charstring b;
		as_sample0();
		if (b) {
			
		}
	}

	altstep as_sample2() {
		var integer a;
		var charstring b;
		[]t.timeout{
		
		}
		
	
	}
	
	testcase tc_sample0() runs on sampleComponent {
		var integer a;
		var charstring b;
		f_sample1();
		if (a){
		
		} else {
			alt{
				[]t.timeout{
				}
				[]as_sample2()
			}		
		}
		
	}

	//the bad ones
	function f_sample1() {

		var integer a;
		timer t1;
		var charstring b;
		as_sample0();
		if (b) {
			var charstring c;
		}
	}

	altstep as_sample1() {

		timer t1;
		const integer x:=1;
		var integer a;
		var charstring b;
		[]t.timeout{
		
		}
		
	
	}


	altstep as_sample0() runs on sampleComponent{
		var integer a;
		var charstring b;
		[]t.timeout{
			timer xt;
			var charstring c;
		}
		
	
	}
	
	testcase tc_sample1() runs on sampleComponent {
		var integer a;
		var charstring b;
		f_sample0();
		if (a){
			var charstring d;
		
		} else {
			alt{
				[]t.timeout{
					timer xx;
					var charstring e;
				}
				[]as_sample1()
			}		
		}
		
	}
	
	type component sampleComponent {

		var integer x;
		const integer cx:=4;
		port portType instance;
		timer tx;
	
	}

	 control {
	 	var integer controlVar;
	 	const integer cx:=4;
		for (var integer x:=1; x< 5; x:=x+1){
		}
	 }
}