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:01 UTC

[jira] [Closed] (GROOVY-11207) STC rejects concatenated string as annotation parameter

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

Paul King closed GROOVY-11207.
------------------------------

> STC rejects concatenated string as annotation parameter
> -------------------------------------------------------
>
>                 Key: GROOVY-11207
>                 URL: https://issues.apache.org/jira/browse/GROOVY-11207
>             Project: Groovy
>          Issue Type: Bug
>          Components: Static Type Checker
>    Affects Versions: 4.0.12
>            Reporter: Christopher Smith
>            Assignee: Eric Milles
>            Priority: Major
>             Fix For: 5.0.0-alpha-3, 4.0.16
>
>
> {code:groovy}
> @CompileStatic
> class Example {
>   public static final String ASDF = 'asdf'
>   @Grab(ASDF + ':asdf:123')
>   // @CompileDynamic
>   void foo() {}
> }
> {code}
> This produces the familiar {{Attribute 'value' should have type 'java.lang.String'; but found type 'java.lang.Object' in @groovy.lang.Grab}} on the annotation value, but applying {{@CompileDynamic}} to the method declaration (alongside the non-working annotation!) fixes it.



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