| Summary: | [dmodel] Problem with wildcards in generated code | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Jan Koehnlein <jan> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P3 | CC: | sebastian.zarnekow |
| Version: | 2.0.0 | Flags: | jan:
indigo+
|
| Target Milestone: | SR1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Pushed to master. Type inference for closures was buggy. Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |
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.