XText 2.3.0M6 problem with setInitializer [message #872824] |
Wed, 16 May 2012 22:28 |
Mark Utting Messages: 9 Registered: August 2011 |
Junior Member |
|
|
I am trying to upgrade from XText 2.2.1 to 2.3.0M6 (2.3.0.v201205081025), but having trouble with the new setBody and setInitializer methods.
For setBody, I can usually just wrap an 'append(...)' around the body and it works okay, but setInitializer is more recalcitrant.
For example, in the following code:
val atoms = new ArrayList<String>()
...
// Generate array of orderby integer values
members += table.orderby.toField("ORDERBY", addArrayTypeDimension(intType)) [
^static = true
^final = true
//was: initializer = ['''{ «atoms.join(", ")», ORDER_END }''']
initializer = [append('''{ «atoms.join(", ")», ORDER_END }''')]
]
the initializer=... line gives the error:
Incompatible types. Expected org.eclipse.xtext.xbase.XExpression but was (null)=>org.eclipse.xtext.xbase.compiler.output.ITreeAppendable
(even though hovering over 'initializer' says that it is using the void setInitializer(JvmField field, Procedure1<ITreeAppendable> strategy) version of setInitializer.)
Can anyone tell me how to fix this?
Is there any documentation about the changes from 2.2.1 to 2.3?
Thanks
Mark
|
|
|
|
Re: XText 2.3.0M6 problem with setInitializer [message #873997 is a reply to message #872824] |
Sat, 19 May 2012 18:08 |
Sven Efftinge Messages: 1823 Registered: July 2009 |
Senior Member |
|
|
Please file a bugzilla.
Sven
Am 5/17/12 12:28 AM, schrieb Mark Utting:
> I am trying to upgrade from XText 2.2.1 to 2.3.0M6
> (2.3.0.v201205081025), but having trouble with the new setBody and
> setInitializer methods.
> For setBody, I can usually just wrap an 'append(...)' around the body
> and it works okay, but setInitializer is more recalcitrant.
>
> For example, in the following code:
>
> val atoms = new ArrayList<String>()
> ...
> // Generate array of orderby integer values
> members += table.orderby.toField("ORDERBY",
> addArrayTypeDimension(intType)) [
> ^static = true
> ^final = true
> //was: initializer = ['''{ «atoms.join(", ")», ORDER_END }''']
> initializer = [append('''{ «atoms.join(", ")», ORDER_END }''')]
> ]
>
> the initializer=... line gives the error:
>
> Incompatible types. Expected org.eclipse.xtext.xbase.XExpression but was
> (null)=>org.eclipse.xtext.xbase.compiler.output.ITreeAppendable
> (even though hovering over 'initializer' says that it is using the void
> setInitializer(JvmField field, Procedure1<ITreeAppendable> strategy)
> version of setInitializer.)
>
> Can anyone tell me how to fix this?
>
> Is there any documentation about the changes from 2.2.1 to 2.3?
>
> Thanks
> Mark
>
--
Need professional support for Xtext or other Eclipse Modeling technologies?
Go to: http://xtext.itemis.com
Twitter : @svenefftinge
Blog : http://blog.efftinge.de
|
|
|
Powered by
FUDForum. Page generated in 0.03282 seconds