Christopher Smith created GROOVY-11207:
------------------------------------------
Summary: 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
{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)