Bug 518040 - suspected spurious warning message: "use 'return' expression to return result from operation. The last expression or 'null' from empty body is returned implicitly"
Summary: suspected spurious warning message: "use 'return' expression to return result...
Status: UNCONFIRMED
Alias: None
Product: QVTo
Classification: Modeling
Component: Engine (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-06-09 03:57 EDT by Jeremy Buisson CLA
Modified: 2017-06-09 03:57 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jeremy Buisson CLA 2017-06-09 03:57:49 EDT
In the same spirit as bug #473151 yet another case where a spurious warning is still reported in 3.6.0v20160606-1156


helper EClass::test() : EClass { // no warning => ok
	var x = 42;
	if(true) {
		return self
	} else {
		return self
	}
}

helper EClass::spurious() : EClass { // spurious warning: "use 'return' expression to return result from operation. The last expression or 'null' from empty body is returned implicitly"
	if(true) {
		return self
	} else {
		var x = 42;
		return self
	}
}

I guess in the second helper, the warning message should not be issued.