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

Bug 351582

Summary: [dmodel] Problem with wildcards in generated code
Product: [Modeling] TMF Reporter: Jan Koehnlein <jan>
Component: XtextAssignee: Project Inbox <tmf.xtext-inbox>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: P3 CC: sebastian.zarnekow
Version: 2.0.0Flags: jan: indigo+
Target Milestone: SR1   
Hardware: All   
OS: All   
Whiteboard:

Description Jan Koehnlein CLA 2011-07-08 10:36:19 EDT
The following dmodel compiles to erroneous code:

  import java.util.*

  package company {
	entity Person {
		name: String
	}
	entity Department { 
		employees: List<Person>
		op findEmployee() : List<Person> {
			employees.sortBy(e|e.name) 
		}
	}
  } 

The closure is compiled to 

  final Function1<? super Person,String> _function 
    = new Function1<? super Person,String>() {
		
which is an illegal use of wildcard types.

Setting severity to major, as this is a regression and occurs only on HEAD. It used to work with the released Xtext version 2.0.
Comment 1 Sebastian Zarnekow CLA 2011-07-18 11:02:57 EDT
Pushed to master. Type inference for closures was buggy.
Comment 2 Karsten Thoms CLA 2017-09-19 17:29:52 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:41:15 EDT
Closing all bugs that were set to RESOLVED before Neon.0