groovy-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David Kron (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (GROOVY-7764) Joint compilation does not work with AST-transformed Groovy
Date Sat, 16 Sep 2017 18:46:01 GMT

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

David Kron commented on GROOVY-7764:
------------------------------------

I cannot agree more with Eric Miles. We have some Groovy/Grails projects which rely heavily
on AST transformations to simplify our business domain layer. But because of this, we are
unable to use some awesome annotation processing libraries like Dagger, Immutables or MapStruct.

In the end, we had to decide for each project what was more important and had to either miss
out on a useful library or port some code back to Java.

> Joint compilation does not work with AST-transformed Groovy
> -----------------------------------------------------------
>
>                 Key: GROOVY-7764
>                 URL: https://issues.apache.org/jira/browse/GROOVY-7764
>             Project: Groovy
>          Issue Type: Bug
>          Components: Stub generator / Joint compiler
>    Affects Versions: 2.4.6
>            Reporter: O. Rei├čig
>         Attachments: foo.zip
>
>
> When using AST transformations together with joint compilation the generated stubs don't
mind the transformations, which may yield invalid classes, that javac will fail to compile.
> Example:
> {code}
> [...]
> class GroovyTest implements Callable {
>     @Delegate
>     private final Callable c = { println "Hello World" }
> }
> {code}
> will get compiled into the following stub:
> {code}
> [...]
> public class GroovyTest
>   extends java.lang.Object  implements
>     java.util.concurrent.Callable,    groovy.lang.GroovyObject {
> ;
> public  groovy.lang.MetaClass getMetaClass() { return (groovy.lang.MetaClass)null;}
> public  void setMetaClass(groovy.lang.MetaClass mc) { }
> public  java.lang.Object invokeMethod(java.lang.String method, java.lang.Object arguments)
{ return null;}
> public  java.lang.Object getProperty(java.lang.String property) { return null;}
> public  void setProperty(java.lang.String property, java.lang.Object value) { }
> }
> {code}
> which claims to implement {{Callable}}, but lacks a {{call}} method.
> I don't know if this is specific to {{@Delegate}}, but noticed similar behaviour with
{{@InheritConstructors}}.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message