Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 368228 - [Xtend] Regression in type inference
Summary: [Xtend] Regression in type inference
Status: CLOSED FIXED
Alias: None
Product: Xtend
Classification: Tools
Component: Core (show other bugs)
Version: 2.2.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: M6   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-10 05:35 EST by Sven Efftinge CLA
Modified: 2017-09-19 17:47 EDT (History)
1 user (show)

See Also:
sven.efftinge: juno+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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