[
https://issues.apache.org/jira/browse/GROOVY-9206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Eric Milles resolved GROOVY-9206.
---------------------------------
Fix Version/s: 5.0.0-alpha-1
Resolution: Fixed
https://github.com/apache/groovy/commit/5fe6fbc7dfef4df52fff6cf96a95b6d46d4fbf3c
> Cannot use annotation with attribute of type char
> -------------------------------------------------
>
> Key: GROOVY-9206
> URL: https://issues.apache.org/jira/browse/GROOVY-9206
> Project: Groovy
> Issue Type: Bug
> Reporter: Eric Milles
> Assignee: Eric Milles
> Priority: Major
> Labels: annotations
> Fix For: 5.0.0-alpha-1
>
>
> Consider the following:
> {code:groovy}
> import java.lang.annotation.*;
> @Target(ElementType.FIELD)
> public @interface A {
> char value();
> }
> ​class C {
> @A((char)';')
> String tokens
> }
> {code}
> This errors with: {{Expected '(char) ;' to be an inline constant of type char
> in @A}}. I've tried a bare 1-character string literal, coercion, an int
> literal, and assignment to a static final field/property with similar
> results. Not sure if it is possible to use this annotation without some kind
> of fix.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)