Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Issue with Xtend2 ListExtensions
Issue with Xtend2 ListExtensions [message #675015] Mon, 30 May 2011 03:36 Go to next message
Joel Denton is currently offline Joel DentonFriend
Messages: 18
Registered: May 2011
Junior Member
Hello,

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>).

There appears to be an issue with type inference using that many extensions in one expression.


Edit: Ok, perhaps not an issue with ListExtensions specifically, but rather with the code generation and use of ListExtensions.

[Updated on: Mon, 30 May 2011 03:43]

Report message to a moderator

Re: Issue with Xtend2 ListExtensions [message #675122 is a reply to message #675015] Mon, 30 May 2011 11:03 Go to previous messageGo to next message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Hi Joel,

please file a ticket.

Thanks,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 30.05.11 05:36, schrieb Joel Denton:
> Hello,
>
> 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>).
>
> There appears to be an issue with type inference using that many
> extensions in one expression.
>
>
Re: Issue with Xtend2 ListExtensions [message #675178 is a reply to message #675122] Mon, 30 May 2011 14:08 Go to previous messageGo to next message
Joel Denton is currently offline Joel DentonFriend
Messages: 18
Registered: May 2011
Junior Member
Bug 347656 has been submitted.
Re: Issue with Xtend2 ListExtensions [message #675452 is a reply to message #675178] Tue, 31 May 2011 14:55 Go to previous message
Sebastian Zarnekow is currently offline Sebastian ZarnekowFriend
Messages: 3118
Registered: July 2009
Senior Member
Joel,

thank you, we'll fix that in the first service release.

Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com

Am 30.05.11 16:08, schrieb Joel Denton:
> Bug 347656 has been submitted.
Previous Topic:XText index builder does not persist EReference
Next Topic:JVM types not found exception.
Goto Forum:
  


Current Time: Thu Apr 25 06:58:44 GMT 2024

Powered by FUDForum. Page generated in 0.03143 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top