Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332481 - InferEngine#visit(IReturnStatement) needs to be updated
Summary: InferEngine#visit(IReturnStatement) needs to be updated
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: General (show other bugs)
Version: 3.2.3   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2.3   Edit
Assignee: Ian Tewksbury CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-13 17:27 EST by Ian Tewksbury CLA
Modified: 2011-01-12 23:48 EST (History)
1 user (show)

See Also:
thatnitind: review+


Attachments
Fix Patch (2.60 KB, patch)
2010-12-13 17:48 EST, Ian Tewksbury CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Tewksbury CLA 2010-12-13 17:27:18 EST
Right now InferEngine#visit(IReturnStatement) checks if the return statement inferred type is == to the existing inferred return type of the current method.  If it is not then it assumes (except for the JSdoc case) that the method has different return types and thus should have the "any" return type.

Problem with this is in the case of multiple implementations of the InferEngine class for the well known types there will be different instances of the same inferred type, in this case we want to continue to use the inferred type and not set it to ANY
Comment 1 Ian Tewksbury CLA 2010-12-13 17:48:27 EST
Created attachment 185098 [details]
Fix Patch

Fixes issue with new logic.  Logic is a bit confusing but I attempted to doc it very well.

All existing junits pass.
Comment 2 Chris Jaun CLA 2011-01-12 16:11:34 EST
Checked into HEAD and 3.2.3