groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul King (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-7951) MethodCallExpression.transformExpression does not copy generic types
Date Mon, 10 Oct 2016 11:32:20 GMT

    [ https://issues.apache.org/jira/browse/GROOVY-7951?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15562037#comment-15562037
] 

Paul King commented on GROOVY-7951:
-----------------------------------

I added an example as a comment in the PR. Also, this error is what is causing a couple of
test failures in https://github.com/apache/groovy/pull/439. Adding macro support to testCompile
removes the generics information that two tests are relying on.

> MethodCallExpression.transformExpression does not copy generic types
> --------------------------------------------------------------------
>
>                 Key: GROOVY-7951
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7951
>             Project: Groovy
>          Issue Type: Bug
>          Components: ast builder
>    Affects Versions: 2.4.7
>            Reporter: Eric Milles
>            Priority: Minor
>
> org.codehaus.groovy.ast.expr.MethodCallExpression.transformExpression(ExpressionTransformer)
is not copying generics info.  Downstream visitors are unable to check generics on static
calls like Collections.<String>emptyList().
> My patched version:
> {code:java}
>     public Expression transformExpression(ExpressionTransformer transformer) {
>         MethodCallExpression answer =
>             new MethodCallExpression(transformer.transform(objectExpression), transformer.transform(method),
transformer.transform(arguments));
>         answer.setSafe(safe);
>         answer.setSpreadSafe(spreadSafe);
>         answer.setImplicitThis(implicitThis);
>         // GRECLIPSE add
>         answer.setGenericsTypes(genericsTypes);
>         // GRECLIPSE end
>         answer.setMethodTarget(target);
>         answer.setSourcePosition(this);
>         answer.copyNodeMetaData(this);
>         return answer;
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message