[ 
https://issues.apache.org/jira/browse/GROOVY-6422?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Paul King updated GROOVY-6422:
------------------------------
    Component/s:     (was: ast builder)

> ClassCodeExpressionTransformer does not visit all expressions
> -------------------------------------------------------------
>
>                 Key: GROOVY-6422
>                 URL: https://issues.apache.org/jira/browse/GROOVY-6422
>             Project: Groovy
>          Issue Type: Bug
>    Affects Versions: 2.2.0-rc-2
>            Reporter: Andreas Vorgeitz
>            Priority: Major
>         Attachments: TestVisitClassCodeExpressionTransformer.groovy
>
>
> 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:
> {code} 
>   public void visitExpressionStatement(ExpressionStatement es) {
>     es.setExpression(transform(es.getExpression()));
>   
>     es.getExpression().visit(this);
>   }  
> {code} 
> 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?



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to