[xcore] String + String operation fails [message #1560229] |
Mon, 12 January 2015 08:21  |
Eclipse User |
|
|
|
Hi,
I just updated to eclipse 4.4.1 from 4.3.1 and noticed the following new error in my xcore file.
within an operation I have the code:
"select startRecord_s, finishRecord_s, timeStep_s from `" + analysis.database.schema + "`.sim WHERE
id = " + analysis.selection.simulation + ";"
and I get the following error:
Ambiguous binary operation.
The operator declarations
operator_plus(Object, String) in ObjectExtensions and
operator_plus(String, Object) in StringExtensions
both match.
This code was no problem in 4.3.1. Does any one has a glue how to solve the error?
Thanks, Martin
|
|
|
|
Re: [xcore] String + String operation fails [message #1586655 is a reply to message #1560257] |
Mon, 26 January 2015 19:25  |
Eclipse User |
|
|
|
Hi Martin,
It seems, that I have a similar issue. I created an xcore file, to replace my existing ecore file for the usage of Sirius and Acceleo. I found, that the Acceleo templates now require an explicit calling of toString() in the usage of xcore where in the ecore case a simple access was sufficient. I look on the ecore file, which was generated from the xcore
class ... {
...
@ExtendedMetaData(kind="attribute", name="theme" )
unique org.eclipse.emf.ecore.xml.^type.String theme
}
and found
<eStructuralFeatures xsi:type="ecore:EAttribute" name="theme" eType="ecore:EDataType ../../org.eclipse.emf.ecore/model/XMLType.ecore#//String">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="theme"/>
</eAnnotations>
</eStructuralFeatures>
whereas in ( original ) ecore it was modelled as
<eStructuralFeatures xsi:type="ecore:EAttribute" name="theme" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="attribute"/>
<details key="name" value="theme"/>
</eAnnotations>
</eStructuralFeatures>
It seems like Acceleo is unable to resolve the type of the variable, because the type for it is resolved as null. I think, your issue can belong to this.
|
|
|
Powered by
FUDForum. Page generated in 0.27335 seconds