Community
Participate
Working Groups
Build Identifier: Xtext 2.2.1 I am trying to adapt Xbase rules to match specific syntax requirements I have. On the parsing side, everything works fine, but once I try to serialize my models, I run into ClassCastExceptions. I have uploaded an example on Github, see https://github.com/openhab/xtext-tests. In this example, I am simply removing the possibility to add type arguments to member feature calls (I copied the Xbase rule and only put one line in comment): https://github.com/openhab/xtext-tests/blob/master/org.xtext.example.mydsl/src/org/xtext/example/mydsl/MyDsl.xtext A very simple test now takes an expression that contains a member feature call: https://github.com/openhab/xtext-tests/blob/master/org.xtext.example.mydsl.tests/src/org/xtext/example/mydsl/SerializerTest.java This test fails with: java.lang.ClassCastException: org.eclipse.xtext.impl.AssignmentImpl cannot be cast to org.eclipse.xtext.Group at org.eclipse.xtext.xbase.services.XbaseGrammarAccess$XMemberFeatureCallElements.<init>(XbaseGrammarAccess.java:853) Note that this test is just ONE example - it happens for all other cases where a Xbase rule is overridden as well. The problem seems to be that the AbstractXbaseSemanticSequencer always refer to the XbaseGrammarAccess instead of the MyDslGrammarAccess (see the injection of XbaseGrammarAccess into the field grammarAccess). Reproducible: Always
*** This bug has been marked as a duplicate of bug 347171 ***