[
https://issues.apache.org/jira/browse/GROOVY-11623?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Sun resolved GROOVY-11623.
---------------------------------
Fix Version/s: 5.0.0-alpha-13
Resolution: Fixed
> Default values for array members in annotations
> -----------------------------------------------
>
> Key: GROOVY-11623
> URL: https://issues.apache.org/jira/browse/GROOVY-11623
> Project: Groovy
> Issue Type: Bug
> Components: Compiler, Static compilation
> Affects Versions: 5.0.0-alpha-12
> Reporter: Saravanan
> Assignee: Eric Milles
> Priority: Minor
> Fix For: 5.0.0-alpha-13
>
>
> When using @CompileStatic, this code does not work
> {code:java}
> @Target({ ElementType.METHOD })
> @Retention(RetentionPolicy.RUNTIME)
> public @interface MyAnnotation {
> Class<?>[] groups() default {};
> Class<? extends MyClazz>[] payloads() default {};
> }{code}
> It causes 2 compile errors
> "Cannot return value of type java.util.ArrayList<#E> for method returning
> java.lang.Class<?>[]" and
> "Cannot return value of type java.util.ArrayList<#E> for method returning
> java.lang.Class<? extends MyClazz>[]"
>
> It does not look like there is any way to express this when static compile is
> turned on
--
This message was sent by Atlassian Jira
(v8.20.10#820010)