Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351582 - [dmodel] Problem with wildcards in generated code
Summary: [dmodel] Problem with wildcards in generated code
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: SR1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-08 10:36 EDT by Jan Koehnlein CLA
Modified: 2017-09-19 17:41 EDT (History)
1 user (show)

See Also:
jan: indigo+


Attachments

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