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 2015/11/17 12:43:10 UTC
[jira] [Created] (GROOVY-7677) AbstractASTTransformation
member-value methods should traverse compile-time constants
Christopher Smith created GROOVY-7677:
-----------------------------------------
Summary: AbstractASTTransformation member-value methods should traverse compile-time constants
Key: GROOVY-7677
URL: https://issues.apache.org/jira/browse/GROOVY-7677
Project: Groovy
Issue Type: Improvement
Components: groovy-jdk
Affects Versions: 2.4.5
Reporter: Christopher Smith
As described [in Cédric's article on parameterized transformations|https://melix.github.io/ast-workshop/exercise4-hints.html], the value of an annotation member during a transformation can be one of several types of expression. The {{AbstractASTTransformation}} class provides a number of methods that "get member values", but only if those values are provided as an *immediate* {{ConstantExpression}}.
Using, for example, a {{public static final String}} as an annotation value is perfectly legitimate, and the current implementation simply treats the value as if it were not present. While it would be some work, I suggest that the behavior of these methods should be enhanced to both traverse property/variable expressions and support retrieval of annotation default values.
If this is agreeable and there's no identifiable technical reason why this isn't feasible, then I'll attempt to implement at least part of the behavior as part of [my blog series|https://blog.chrylis.com/2015/11/13/introducing-gjt/] and would like to explore merging it into the main distribution.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)