Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » [EGL] Expected to return a Set, but returned a class
[EGL] Expected to return a Set, but returned a class [message #1012416] Thu, 21 February 2013 14:27 Go to next message
Patricia Fernández is currently offline Patricia FernándezFriend
Messages: 41
Registered: October 2012
Member
Hello,

I created an .egl file (called OperationsC.egl). It includes, simplified version, this operation:

[%
@template
operation currentPackages(): Set { 
	var packages : Set;
	for (pack in Package.all) {	
		packages.add(pack);
	}
	return packages;
} %]


I have another .egl file where I want to use that operation:

[%
import "OperationsC.egl";

var packages : Set;
packages = currentPackages();

packages.println();

%] 


But it's not working, giving me this error: currentPackages is expected to return a Set, but returned a class java.lang.String

I checked that the operation I created returns a Set and it does. I can't see what I'm doing wrong, if someone could help me... Thanks in advance!

[Updated on: Thu, 21 February 2013 14:30]

Report message to a moderator

Re: [EGL] Expected to return a Set, but returned a class [message #1012427 is a reply to message #1012416] Thu, 21 February 2013 14:41 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Patricia,

I believe that @template operations always return a string. To make this work, you'll need to remove the @template operation.

Cheers,
Dimitris
Re: [EGL] Expected to return a Set, but returned a class [message #1012428 is a reply to message #1012427] Thu, 21 February 2013 14:41 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

"remove the @template operation" should read "remove the @template annotation" instead...
Re: [EGL] Expected to return a Set, but returned a class [message #1012429 is a reply to message #1012427] Thu, 21 February 2013 14:43 Go to previous message
Patricia Fernández is currently offline Patricia FernándezFriend
Messages: 41
Registered: October 2012
Member
Thank you so much Dimitris, works perfectly now.
Previous Topic:Palette configuration using Eugenia
Next Topic:issue need your urgent attention regarding EVL constraints
Goto Forum:
  


Current Time: Wed Apr 24 19:42:39 GMT 2024

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

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

Back to the top