[ https://issues.apache.org/jira/browse/GROOVY-3952?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul King updated GROOVY-3952: ------------------------------ Fix Version/s: (was: 3.x) 4.x > CLONE -Groovy Support for annotations on local variable declarations: Part II > - Allow Local Transforms to process such annotations > ---------------------------------------------------------------------------------------------------------------------------------- > > Key: GROOVY-3952 > URL: https://issues.apache.org/jira/browse/GROOVY-3952 > Project: Groovy > Issue Type: New Feature > Components: ast builder > Affects Versions: 1.7.0 > Environment: All > Reporter: Paul King > Priority: Major > Fix For: 4.x > > > Groovy should support annotations on local variable declarations. It is > syntactically legal to annotate a local variable, but the AST produced does > not carry that annotation. > My use case with the AST builder. Either we'd like to annotate a local > variable, like this: > {code} > @AstSource(CompilePhase.CONVERSION) > def source = { println "compiled on: ${new Date()}" } > {code} > Or annotate a property within a closure (which is a > {{DeclarationExpression}}), like this: > {code} > def result = new AstBuilder().build { > phase = CompilePhase.CONVERSION > @AstSource > source = { println "compiled on: ${new Date()}" } > } > {code} > A {{getAnnotations()}} method should probably be added to > {{DeclarationExpression}} to support this. -- This message was sent by Atlassian Jira (v8.3.4#803005)