Skip to main content



      Home
Home » Modeling » EMF » [Xcore] produces non-compiling Java code when using closures
[Xcore] produces non-compiling Java code when using closures [message #965783] Wed, 31 October 2012 09:58 Go to next message
Eclipse UserFriend
Hello,

I am referring to http://wiki.eclipse.org/Xcore # Specifying an Operation.

Assume the following method is added to the Library class:
   op Book[] findBooksByAuthor (Author author) {
      return authors.filter [it == author].toList
   }


produces two problems:
1.) an EList is expected instead of List
2.) the generated code contains an anonymous inner class and the "author" param is not final

Regards,
Nicolas
Re: [Xcore] produces non-compiling Java code when using closures [message #965809 is a reply to message #965783] Wed, 31 October 2012 10:14 Go to previous message
Eclipse UserFriend
Nicolas,

All the parameters should be final in the recent nightly builds. These
builds also include support for extension methods, so you can write toEList.


On 31/10/2012 2:58 PM, Nicolas Cabanis wrote:
> Hello,
>
> I am referring to http://wiki.eclipse.org/Xcore # Specifying an
> Operation.
>
> Assume the following method is added to the Library class:
>
> op Book[] findBooksByAuthor (Author author) {
> return authors.filter [it == author].toList
> }
>
>
> produces two problems:
> 1.) an EList is expected instead of List
> 2.) the generated code contains an anonymous inner class and the
> "author" param is not final
>
> Regards,
> Nicolas
Previous Topic:[TEXO] ModelXMLLoader mapping
Next Topic:Get the selected menu item
Goto Forum:
  


Current Time: Tue Jul 22 20:43:38 EDT 2025

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

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

Back to the top