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

Bug 350932

Summary: [Xbase/Xtend] Illegal code generated for inferred return types
Product: [Modeling] TMF Reporter: Stephane Barbey <stephane>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: unspecifiedFlags: sebastian.zarnekow: indigo+
Target Milestone: SR1   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Stephane Barbey CLA 2011-07-01 08:56:31 EDT
Build Identifier:  I20110613-1736

The following Xtenc class:

package gub
class Buggy {
	def buggy() {
		if (true) return false;
	}	
}

generated the following Java code:

package gub;


@SuppressWarnings("all")
public class Buggy {
  
  public Boolean buggy() {
    Object _xifexpression = null;
    if (true) {
      return false;
    }
    return _xifexpression;
  }
}

which is illegal because _xifexpression is not a Boolean.



Reproducible: Always
Comment 1 Sebastian Zarnekow CLA 2011-07-18 15:28:40 EDT
Pushed to master.
Comment 2 Karsten Thoms CLA 2017-09-19 17:45:38 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:56:38 EDT
Closing all bugs that were set to RESOLVED before Neon.0