Bug 476795 - [typesystem] Wrong return type calculated with early exists and endless loop
Summary: [typesystem] Wrong return type calculated with early exists and endless loop
Status: NEW
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.8.4   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-07 09:12 EDT by Jan Koehnlein CLA
Modified: 2015-09-07 09:12 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 Jan Koehnlein CLA 2015-09-07 09:12:41 EDT
The following yields an error "Type mismatch: cannot convert from void to String"

def String test(String dir) {
  while (true) {
    try {
      return dir
    } catch (RuntimeException e) {
    }
  }
}

Should be no error.

Spotted when auto-converting some Java code to Xtend.