Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
epidemian
GitHub Repository: epidemian/gravity
Path: blob/master/test/03-semantic_step2/invalid_condition_if.gravity
1214 views
#unittest {
	name: "Semantic, If statement condition, Assignment not allowed here.";
	error: SEMANTIC;
	error_row: 11;
	error_col: 6;
};

func main () {
	var i,v = 0;

	if (i = 1) {	// Assignment not allowed as a condition
		v = 1;
		v = 2;
	} else v = 3;

return v;
}