Hi Alexander,
you get this error because those types are not in a type hierarchy and
cannot be casted therefore.
The type hierarchy is as follows:
Element <- NamedElement <- TypedElement <- ConnectableElement
Element <- MultiplicityElement
You may consult the UML2 superstructure. Seems that the
ConnactableElement's role is not an MultiplicityElement.
~Karsten
Alexander Nyßen schrieb:
I have specified the following in my Extension:
cached int getConnectorCount(uml::ConnectorEnd e) :
uml::MultiplicityElement.isInstance(e.role) ?
e.getPartWithPortMultiplicity() * e.upper() *
((uml::MultiplicityElement)e.role).upper()
: e.getPartWithPortMultiplicity() * e.upper()
;
The cast of e.role into MultiplicityElemenet is acknowledged by the
OAW environement with the error "cannot cast from
uml::ConnectableElement into uml::MultiplicityElement". The dynamic
type of e.role may however by a MultiplicityElement. What am I doing
wrong?