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

Bug 368228

Summary: [Xtend] Regression in type inference
Product: [Tools] Xtend Reporter: Sven Efftinge <sven.efftinge>
Component: CoreAssignee: Project Inbox <xtend-inbox>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: 2.2.0Flags: sven.efftinge: juno+
Target Milestone: M6   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Sven Efftinge CLA 2012-01-10 05:35:40 EST
The following code results in incorrect Java code. 
The inferred return type of the last method is Object, but should be List<?>.
Since this involves recursion an error marker requiring declaration of return types would be appropriate too.

class Case_6 {

	def dispatch transform(EPackage packageDecl) {
		packageDecl.eContents.map(e | transform(e as EStructuralFeature))
	}
	
	
	def dispatch transform(EStructuralFeature entity) {
		val inferredType = null
		newArrayList(inferredType as EObject) 	 
	}
	
	def dispatch transform(EClass model) {
		model.ETypeParameters.map(e| transform(e))
	}

}
Comment 1 Sebastian Zarnekow CLA 2012-04-04 03:46:32 EDT
List<? extends Object> is inferred which looks good to me.
Comment 2 Karsten Thoms CLA 2017-09-19 17:36:32 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:47:28 EDT
Closing all bugs that were set to RESOLVED before Neon.0