Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Xpand] Strange behaviour of polymorphism when using stereotypes
[Xpand] Strange behaviour of polymorphism when using stereotypes [message #665332] Thu, 14 April 2011 07:08
Thomas  is currently offline Thomas
Messages: 1
Registered: April 2011
Junior Member
Hi all,

i have encountered a strange problem when using polymorphism to resolve stereotypes applied to class properties or to association ends.

There is a stereotype "Generic", which is applicable to UML::Element.

This is the Xpand fragment in question:

«DEFINE typeArguments FOR xxx::Generic»
«do something»
«ENDDEFINE»

«DEFINE typeArguments FOR uml::Property»
«IF xxx::Generic.isInstance(this)»
/* ?! */
«ENDIF»
«ENDDEFINE»

The /* ?! */ marker indeed appears in the generated source code. When trying to EXPAND something requiring a xxx:Generic instead, an exception is thrown indicating the lack of a matching definition, however:

No Definition 'something for uml::Property' found!

Explicitly checking for the "Generic" stereotype and its tagged values can be used instead. Did i miss something about Xpand polymorphism or is this a bug in the interpreter?

Any help appreciated.

- Thomas
Previous Topic:Re: [Xtend / Check] using multiple check files
Next Topic:[Acceleo3] Strange template invocation error
Goto Forum:
  


Current Time: Sat Aug 23 07:30:50 EDT 2014

Powered by FUDForum. Page generated in 0.04255 seconds