I marked the line, where the error occurs. The problem is:
"Couldn't find operation '+(uml::String)' for type 'String'".

I tried explizit casting, but it did not work:
"«FILE "\\" + (String)this.name + "foo"»".
But it would work like that:
"«FILE "\\" + (String)this.name»".
While this does not work:
"«FILE "\\" + this.name»".

And another (for me) interesting fact: If I use the template by using
Xpand programmaticly, it works just fine. So why does the editor (and
problem-view) have problems?

Change the order of the UML and EMF metamodel contributors in the
project settings. UML must come first when using both, otherwise EMF
wins and maps the String primitive type to an EClassType, but the UML
typesystem recognizes the primitives and maps them to the builtin
typesystem.

~Karsten

~Karsten

On 25.05.09 12:40, Jan Koehnlein wrote:
> Hmm, looks like a bug in the tooling around the UML typesystem. I filed
> a bug for that
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=277666
>
> I hope we can fix it before the Galileo release.
>
> Regards
> Jan
>
> Usul schrieb:
>> In the XPand-Editor, I get an error when trying to concatenate a
>> string with a model-value. Here is my template:
>>
>> «IMPORT otml»
>> «IMPORT uml»
>>
>> «DEFINE main FOR Model»
>> «EXPAND showpackages FOREACH this.nestedPackage» «ENDDEFINE»
>>
>> «DEFINE showpackages FOR Package»
>> «FILE "\\" + this.name + "foo"» <---- ERROR HERE
>> test
>> «ENDFILE»
>> «ENDDEFINE»
>>
>> I marked the line, where the error occurs. The problem is: "Couldn't
>> find operation '+(uml::String)' for type 'String'". I tried explizit
>> casting, but it did not work: "«FILE "\\" + (String)this.name +
>> "foo"»". But it would work like that: "«FILE "\\" +
>> (String)this.name»". While this does not work: "«FILE "\\" + this.name»".
>>
>> And another (for me) interesting fact: If I use the template by using
>> Xpand programmaticly, it works just fine. So why does the editor (and
>> problem-view) have problems?
>>
>>
>>
>> Thank you for any help
>>

> Change the order of the UML and EMF metamodel contributors in the
> project settings. UML must come first when using both, otherwise EMF
> wins and maps the String primitive type to an EClassType, but the UML
> typesystem recognizes the primitives and maps them to the builtin
> typesystem.

> ~Karsten

In "Project"->"Properties"->"Xtend/Xpand" I checked both "UML2 profiles"
and "EMF Metamodels" and put "UML2 profiles" up to first place. The
example I posted works then. But this does not work:

That is pretty strange, because only one (seemingly random) line is
affected. Without your solution, the line marked with "*" also had Error
1 (that error diesappeared).

> On 25.05.09 12:40, Jan KÂoehnlein wrote:
>> Hmm, looks like a bug in the tooling around the UML typesystem. I filed
>> a bug for that
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=277666
>>
>> I hope we can fix it before the Galileo release.
>>
>> Regards
>> Jan
>>
>> Usul schrieb:
>>> In the XPand-Editor, I get an error when trying to concatenate a
>>> string with a model-value. Here is my template:
>>>
>>> Â«IMPORT otmlÂ»
>>> Â«IMPORT umlÂ»
>>>
>>> Â«DEFINE main FOR ModelÂ»
>>> Â«EXPAND showpackages FOREACH this.nestedPackageÂ» Â«ENDDEFINEÂ»
>>>
>>> Â«DEFINE showpackages FOR PackageÂ»
>>> Â«FILE "\" + this.name + "foo"Â» <---- ERROR HERE
>>> test
>>> Â«ENDFILEÂ»
>>> Â«ENDDEFINEÂ»
>>>
>>> I marked the line, where the error occurs. The problem is: "Couldn't
>>> find operation '+(uml::String)' for type 'String'". I tried explizit
>>> casting, but it did not work: "Â«FILE "\" + (String)this.name +
>>> "foo"Â»". But it would work like that: "Â«FILE "\" +
>>> (String)this.nameÂ»". While this does not work: "Â«FILE "\" + this.nameÂ»".
>>>
>>> And another (for me) interesting fact: If I use the template by using
>>> Xpand programmaticly, it works just fine. So why does the editor (and
>>> problem-view) have problems?
>>>
>>>
>>>
>>> Thank you for any help
>>>