You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Christopher Smith (JIRA)" <ji...@apache.org> on 2018/09/05 11:54:00 UTC
[jira] [Commented] (GROOVY-7764) Joint compilation does not work
with AST-transformed Groovy
[ https://issues.apache.org/jira/browse/GROOVY-7764?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16604316#comment-16604316 ]
Christopher Smith commented on GROOVY-7764:
-------------------------------------------
This is a blocker for some of my use cases as well. I have a minimal demonstrable use case [with my {{@GbtVersion}}|https://github.com/chrylis/groovybeans-toolkit] transform, which is essentially the same as {{@Slf4j}} but adds an externally visible {{@Version}} property. Stubs don't include the version accessors (and, more crucially, the ID accessors). The transformation runs during SEMANTIC_ANALYSIS.
> 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
> Priority: Major
> 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
(v7.6.3#76005)