| Summary: | Issue with Xtend2 ListExtensions | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Joel Denton <joeldenton> | ||||
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | jan, sebastian.zarnekow | ||||
| Version: | 2.0.0 | Flags: | sebastian.zarnekow:
indigo+
|
||||
| Target Milestone: | SR1 | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Scheduled for SR1. Created attachment 199187 [details]
Patch to rsolve type argument
Please revise the patch: The component type of the array returned by String.split() is not used to resolve the tapeArgument in the call to reverse(). Patch looks good to me. Could you add a test case, too? Patch and test 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 |
Build Identifier: Xtend2 SDK 2.0.0.v201105271731 Using Xtend2, the following line: 'foo,bar,baz'.split(',').reverse().join(',') generates the following Java code: String[] _split = "foo,bar,baz".split(","); List<String> _reverse = ListExtensions.<Object>reverse(((List<String>)Conversions.doWrapArray(_split))); String _join = IterableExtensions.join(_reverse, ","); return _join; with exception: The parameterized method <Object>reverse(List<Object>) of type ListExtensions is not applicable for the arguments (List<String>). Curent workaround is to split into multiple expressions: var z = 'foo,bar,baz'.split(',').reverse() z.join(',') Reproducible: Always Steps to Reproduce: 1. In Xtend file: 'foo,bar,baz'.split(',').reverse().join(',') 2. Error in generated Java