Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 352844 - [Xtend] Auto-(Un)Boxing feature of Java 5 not supported by Function types with void parameters (in generated code)
Summary: [Xtend] Auto-(Un)Boxing feature of Java 5 not supported by Function types wit...
Status: CLOSED FIXED
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext (show other bugs)
Version: 2.0.0   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: SR1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-22 05:59 EDT by Sebastian Zarnekow CLA
Modified: 2017-09-19 17:04 EDT (History)
0 users

See Also:
sebastian.zarnekow: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sebastian Zarnekow CLA 2011-07-22 05:59:54 EDT
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
Comment 1 Sebastian Zarnekow CLA 2011-07-22 06:29:00 EDT
Pushed to master.
Comment 2 Karsten Thoms CLA 2017-09-19 16:53:48 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 3 Karsten Thoms CLA 2017-09-19 17:04:38 EDT
Closing all bugs that were set to RESOLVED before Neon.0