1

How can a variable of type char be assigned? I am looking for the Xtend equivalent of javas:

char c='?';

In Xtend the compiler reject all quotation marks like ' or " because they produce a String:

var char c='?'; 

^ Error: Incompatible types. Expected char or java.lang.Character but was java.lang.String

Xtext Version is 2.2

4

2 回答 2

3

Since 2.4 you can write:

val char c = '?'
于 2013-03-09T16:04:48.187 回答
1

Currently you have to use '?'.charAt(0).

于 2012-06-12T09:54:55.377 回答