| Summary: | [xtend] error inferring return type of generic function type reference closure | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Knut Wannheden <knut.wannheden> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | sebastian.zarnekow |
| Version: | 2.0.0 | Flags: | sebastian.zarnekow:
indigo+
|
| Target Milestone: | SR1 | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
Pushed to master. Closing all bugs that were set to RESOLVED before Neon.0 Closing all bugs that were set to RESOLVED before Neon.0 |
The following Xtend2 snippet: def <T extends =>Integer> baz(T t) { t.apply } is compiled to: public <T extends Function0<Integer>> Object baz(final T t) { ? _apply = t.apply(); return _apply; } This Java code has compile errors. The problem seems to be that the type of the expression t.apply() is inferred as Object instead of Integer. It should be compiled to: public <T extends Function0<Integer>> Integer baz(final T t) { Integer _apply = t.apply(); return _apply; }