You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (Jira)" <ji...@apache.org> on 2023/12/22 11:39:00 UTC

[jira] [Closed] (GROOVY-11206) Concatenated strings not treated as compile-time constants

     [ https://issues.apache.org/jira/browse/GROOVY-11206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Paul King closed GROOVY-11206.
------------------------------

> Concatenated strings not treated as compile-time constants
> ----------------------------------------------------------
>
>                 Key: GROOVY-11206
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11206
>             Project: Groovy
>          Issue Type: Bug
>          Components: Compiler
>    Affects Versions: 4.0.12
>            Reporter: Christopher Smith
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 5.0.0-alpha-3, 4.0.16
>
>
> This problem was marked fixed with GROOVY-9855, but I'm seeing (a variant of?) it again:
> {code:groovy}
> @Grab(Example.CONSTANT)
> // ^ The value for annotation attribute Grab.value must be a constant expression
> class Example {
>   public static final String GROUP = 'asdf'
>   public static final String CONSTANT = GROUP + ':asdf:0.1'
> }
> {code}
> In case it's relevant, the non-minimal case involves a statically imported constant from another class:
> {code:groovy}
> class MyController {
>   public static final String PARAM_OWNER = 'filter[' + REL_OWNER + ']'
>   @GetMapping(params = PARAM_OWNER)
>   // ^ Expected 'PARAM_OWNER' to be an inline constant of type java.lang.String not a field expression in @org.springframework.web.bind.annotation.GetMapping
>   ...
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)