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

Bug 457069

Summary: Inferencing ignores @returns tag with no actual return statement
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED INVALID QA Contact:
Severity: normal    
Priority: P3    
Version: 8.0   
Target Milestone: ---   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Michael Rennie CLA 2015-01-08 13:22:47 EST
Consider the following snippet:

/**
* @returns {Number}
*/
Foo.bar = function() {};

if you activate assist on Foo. you will see the return type of bar is listed as 'undefined', but it is explicitly doc'd as Number.

If you change the snippet to include a return statement it works as expected:

/**
* @returns {Number}
*/
Foo.bar = function() {return 2;};
Comment 1 Michael Rennie CLA 2015-02-12 16:02:37 EST
Support for the @returns tag was added in bug 459499, but it looks like we are failing to find the doc associated with the ExpressionStatement.
Comment 2 Michael Rennie CLA 2015-05-08 10:58:38 EDT
Tern handles our type inferencing now.

Closing invalid.