Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Enumeration arguments in operations
Enumeration arguments in operations [message #573982] Wed, 12 August 2009 17:16
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 472
Registered: January 2010
Senior Member
Hello all,

I've defined an operation which takes an enumeration literal as a
parameter. Oddly enough, it doesn't work when I declare it as such. It
does work when I declare that parameter to be of type Any.

For testing, I've defined an Ecore model whose Emfatic source looks like

@namespace(uri="testEnumArgs", prefix="ea")
package EnumArgs;

enum Color {

If I run the following EOL script against an empty model which conforms
to the previous metamodel, the first call works, but the second reports
"Type 'Color' not found":

toggle(Color#RED).println('Color A: ');
brokenToggle(Color#RED).println('Color A: ');

operation toggle(color : Any) {
if (color = Color#RED) {
return Color#BLUE;
} else {
return Color#RED;

operation brokenToggle(color : Color) {
if (color = Color#RED) {
return Color#BLUE;
} else {
return Color#RED;

Is this a bug, or am I doing something wrong?

Just in case, I've submitted a bug with a sample project which
reproduces the issue:

Previous Topic:[EGL] CrossReferences
Next Topic:Enumeration arguments in operations
Goto Forum:

Current Time: Thu May 24 15:44:51 GMT 2018

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

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

Back to the top