Community
Participate
Working Groups
Created attachment 206753 [details] Screenshot The Xtext Grammar Editor shows an error for a cross-reference, although the respective EClass does have an appropriate EReference. Cannot find compatible feature type in sealed EClass MetaClass from imported package http://code.google.com/a/eclipselabs.org/p/spray: The existing reference 'type' has an incompatible type 'EClass' [org.eclipse.emf.ecore.EClass]. The expected type is 'EClass'. The Ecore packages are imported with NS URI, as recommended. import "http://code.google.com/a/eclipselabs.org/p/spray" import "http://www.eclipse.org/emf/2002/Ecore" as ecore The EReference uses also NS URI for the EReference: <eClassifiers xsi:type="ecore:EClass" name="MetaClass" eSuperTypes="#//SprayElement"> <eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EClass"/> </eClassifiers>
For reproduction use git clone https://code.google.com/a/eclipselabs.org/p/spray/ and use tag "bug363421"
As soon as you use something from the ecore.ecore which is not a EDatatype or EObject itself, you'll have to reference it via platform:/resource or platform:/plugin in your own ecore file. EDatatypes and EObject have a special role in EMF when it comes to assignability. Could you please double check whether that works? Will update the docs accordingly.
Changed this accordingly <eClassifiers xsi:type="ecore:EClass" name="MetaClass" eSuperTypes="#//SprayElement"> <eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EClass"/> </eClassifiers> The problem markers remain. I had to add URI maps in the workflow to map the plugin resource URIs. The reproducing tag has been updated. If this is not an Xtext bug, but more a user bug, we can close the ticket here and discuss a solution in the forum.
This is what we use in Xtext.ecore: <eStructuralFeatures xsi:type="ecore:EReference" name="classifier" eType="ecore:EClass platform:/resource/org.eclipse.emf.ecore/model/Ecore.ecore#//EClassifier"/> > For reproduction use > git clone https://code.google.com/a/eclipselabs.org/p/spray/ > and use tag "bug363421" I don't have enough credentials to clone from this location.
I can confirm that Xtext.xtext does not show these errors. Now I have tried to change the plugin URIs to platform resource URIs. No problem with generating EMF classes or run the Xtext generator, just UI problem. We have a problem with Google Code at the moment so that the pages cannot be accessed without logging in with a Google Account. Thus, I am uploading the exported files now here: http://dl.dropbox.com/u/662339/Exchange/Spray_bug363421.zip
Fixed in master and maintenance
Closing all bugs that were set to RESOLVED before Neon.0