Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 327989

Summary: Switch-case Return
Product: [Modeling] Epsilon Reporter: Henning <Hager.Henning>
Component: CoreAssignee: Dimitris Kolovos <dkolovos>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Henning CLA 2010-10-17 06:21:31 EDT
When placing a return in a case of a switch statement the owning operation is not immediately left. The following code demonstrates this behavior:

rule switchexample
	transform d : Source!Domain
	to d : Target!Domain{

	callSomeOperation().println();		
}
operation callSomeOperation() : String{
	var choice = "choice_1";
	
	switch (choice){
		case "choice_1":
			"choice detected".println(); 
			return "first choice chosen!";
	}
	return "nothing chosen";
}

The output should be "choice detected" but instead it is "choice detected" and "nothing chosen".
Comment 1 Dimitris Kolovos CLA 2010-10-17 06:32:32 EDT
Fixed in the SVN and in the latest interim version (0.8.9.201010171057)
Comment 2 Dimitris Kolovos CLA 2010-11-25 08:23:24 EST
Fixed in 0.9.0.