Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
2.2.0-rc-2
-
None
-
None
Description
When testing the ClassCodeExpressionTransformer I found out that not all of my expressions got visited (i.e. DeclarationExpression). I found out that the method visitExpressionStatement() does not call the visit method for the subnodes like the ClassCodeVisitor does.
When overriding the method visitExpressionStatement() and adding a:
public void visitExpressionStatement(ExpressionStatement es) { es.setExpression(transform(es.getExpression())); es.getExpression().visit(this); }
my transformations worked again. I have not checked if all the other visit...() methods do call the necessary visit() methods for the branches of the AST, but this addition to the ClassCodeExpressionTransformer fixed my problems.
I added a test case. When you add the part that is commented out, the test runs "good".
Could you please check the ClassCodeExpressionTransformer?