You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2020/12/21 16:06:00 UTC
[jira] [Assigned] (GROOVY-9855) Compiler does not resolve
compile-time constants in string concatenation
[ https://issues.apache.org/jira/browse/GROOVY-9855?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles reassigned GROOVY-9855:
-----------------------------------
Assignee: Eric Milles
> Compiler does not resolve compile-time constants in string concatenation
> ------------------------------------------------------------------------
>
> Key: GROOVY-9855
> URL: https://issues.apache.org/jira/browse/GROOVY-9855
> Project: Groovy
> Issue Type: Bug
> Components: Compiler, Static compilation
> Affects Versions: 3.0.7
> Reporter: Christopher Smith
> Assignee: Eric Milles
> Priority: Minor
>
> {code:groovy}
> @Qualifier(ConfigProps.PREFIX + '.suffix')
> @CompileStatic
> class ConfigProps {
> public static final String PREFIX = 'prefix'
> }
> {code}
> In this case, the value ({{prefix.suffix}}) is a compile-time constant and should be available as an annotation parameter, but the compiler does not recognize this. Both plain and static compilation produce errors, though different errors:
> dynamic:
> {code}
> The value for annotation attribute Qualifier.value must be a constant expression
> {code}
> static:
> {code}
> Attribute 'value' should have type 'java.lang.String'; but found type 'java.lang.Object'
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)