I am Xtend/Xtext newbie. Currently I am working with new formatter API, and i am trying to format rule, which looks like this:
Expression:
Error|Warning|Enum|Text
;
with xtend dispatch method like this
def dispatch void format(Expression e){
if (e instanceof ErrorImpl)
((ErrorImpl)e).format
}
Problem is, that type of expression e is uncovertable, I am recieving this error
Type mismatch: cannot convert from Class<ErrorImpl> to Expression
Why i cannot do this conversion (i suspect xTend semantics of course)(even Eclipse tells me that Expression is just interface from which children are created.) and how can i call format method for every child of this rule? Thanks.