today I run into a strange problem:
I'm using some ecore models (dynamic EMF):
<bean class="org.eclipse.mwe.emf.StandaloneSetup">
<platformUri value=".." />
<registerEcoreFile value="${redview.meta.model.dir.uri}binding.ecore"/>
<registerEcoreFile value="${redview.meta.model.dir.uri}datatypes.ecore"/>
<registerEcoreFile value="${redview.meta.model.dir.uri}elements.ecore"/>
<registerEcoreFile value="${redview.meta.model.dir.uri}layout.ecore"/>
<registerEcoreFile value="${redview.meta.model.dir.uri}styles.ecore"/>
<registerEcoreFile value="${redview.meta.model.dir.uri}validation.ecore"/>
</bean>
and in my XTend I import these models
import persist_eg;
import uml;
import ecore;
import binding;
import datatypes;
import elements;
import layout;
import styles;
import validation;
all worked well until I run in this scenario:
private Void setDefaultColorStyle4Base (styles::RStyle st) :
st.setBgColor(datatypes::RColors::DEFAULT_BG) ->
st.setFgColor(datatypes::RColors::DEFAULT_FG);
the editor was happy, but running the workflow I got
EvaluationException : The value of type 'class org.eclipse.emf.ecore.impl.EEnumLiteralImpl' must be of type 'org.eclipse.emf.ecore.impl.EEnumImpl
because EEnumLiterals work fine in other places I tried to find the reason.
and I found it
its because the EEnumLiterals are in another ecore.
moving the EEnumLiterals from datatypes to styles all works well:
private Void setDefaultColorStyle4Base (styles::RStyle st) :
st.setBgColor(styles::RColors::DEFAULT_BG) ->
st.setFgColor(styles::RColors::DEFAULT_FG);
tried some more things and it was reproduceable: if the EEnumLiteral was in another ecore then the property I try to set with such a Literal,
I got an error
trying the same ecore models using EMF Model Editor causes no problems, I can set the Literals independent from location
is this a known bug ?
ekke