| Summary: | [Xtend] Auto-(Un)Boxing feature of Java 5 not supported by Function types with void parameters (in generated code) | ||
|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Sebastian Zarnekow <sebastian.zarnekow> |
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> |
| Status: | CLOSED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | Flags: | sebastian.zarnekow:
indigo+
|
| Version: | 2.0.0 | ||
| Target Milestone: | SR1 | ||
| Hardware: | PC | ||
| OS: | Mac OS X - Carbon (unsup.) | ||
| 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 |
Xtend code (compiles): def generate(DomainModel d, IFileSystemAccess fsa) { // TODO: Use spreading operator: d.elements*.(e | e.generate(fsa)) d.elements.iter(e | e.generate(fsa)) // e.generate returns void } def <T,R> iter(java.util.List<T> list, (T)=>R predicate) { for(element : list) { predicate.apply(element); } } Generated code (does not compile): ... // e | e.generate(fsa) final Function1<AbstractElement, void > _function = new Function1<AbstractElement, void >() { ... Workaround: d.elements.iter(e | e.generate(fsa) as Void) one would expect that Xtend code does not compile if Java code does not compile