Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 327989 - Switch-case Return
Summary: Switch-case Return
Status: CLOSED FIXED
Alias: None
Product: Epsilon
Classification: Modeling
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Dimitris Kolovos CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-17 06:21 EDT by Henning CLA
Modified: 2012-02-06 10:59 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.