package xtend.tutorial.basicsimport java.io.File
class Xtend01_HelloWorld {
// mismatched input 'val' expecting '}'val separator2 =
java::io::File::separator}
https://gist.github.com/1561606
the following is valid (since Xtend 2.2):
package xtend.tutorial.basics
class Xtend01_HelloWorld {
static String separator2 = java::io::File::separator
}
Note that type inference is currently not supported for field declarations thus you'll have to specify the type explicitly.
Regards,
Sebastian
I'm looking forward to bug 367885 being fixed so fields can be both
static and final.