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 09:27 Go to next message
Patricia Fernández is currently offline Patricia Fernández
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 09: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 09:41 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 700
Registered: July 2009
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 09:41 Go to previous messageGo to next message
Dimitris Kolovos is currently offline Dimitris Kolovos
Messages: 700
Registered: July 2009
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 09:43 Go to previous message
Patricia Fernández is currently offline Patricia Fernández
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: Sat Apr 19 16:02:21 EDT 2014

Powered by FUDForum. Page generated in 0.03124 seconds