Bug 423293 - Erroneus usage of 'return' / 'break' / 'continue' / 'raise' should be prohibited
Summary: Erroneus usage of 'return' / 'break' / 'continue' / 'raise' should be prohibited
Status: ASSIGNED
Alias: None
Product: QVTo
Classification: Modeling
Component: Engine (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-12-05 06:55 EST by Alex Paperno CLA
Modified: 2014-09-04 08:27 EDT (History)
1 user (show)

See Also:


Attachments
The patch reports an error for cases where raise/return/break/continue is ised as an part of an expression (9.00 KB, patch)
2014-05-22 20:57 EDT, Alex Paperno CLA
no flags Details | Diff
A unit test for the patch (1.89 KB, patch)
2014-05-22 20:58 EDT, Alex Paperno CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Paperno CLA 2013-12-05 06:55:21 EST
While the specification does not explicitly prohibits usage of ReturnExp, RaiseExp, BreakExp and ContinueExp in the following cases, all of them seem to be erroneous and should be treated as such.

------------------------------
modeltype Ecore uses "http://www.eclipse.org/emf/2002/Ecore";
transformation T1(in inModel : Ecore, out outModel : Ecore) 
{
	main() {
		while (true)
		{
			return break;
			return continue;
			return raise "aa";
		};
		var a = return;
		var b = return (return);
		return return;
	}
}
Comment 1 Alex Paperno CLA 2014-05-22 20:57:20 EDT
Created attachment 243418 [details]
The patch reports an error for cases where raise/return/break/continue is ised as an part of an expression
Comment 2 Alex Paperno CLA 2014-05-22 20:58:50 EDT
Created attachment 243419 [details]
A unit test for the patch