[ https://issues.apache.org/jira/browse/GROOVY-9205?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Milles updated GROOVY-9205: -------------------------------- Labels: annotations (was: ) > Specify primitive annotation default value using number literal with > cast/coerce > -------------------------------------------------------------------------------- > > Key: GROOVY-9205 > URL: https://issues.apache.org/jira/browse/GROOVY-9205 > Project: Groovy > Issue Type: Bug > Reporter: Eric Milles > Priority: Minor > Labels: annotations > > Consider the following: > {code:groovy} > @interface A { > int i1() default (int) 42 > int i2() default 42 as int > byte b1() default (byte) 42 > byte b2() default 42 as byte > char c1() default (char) 42 > char c2() default 42 as char > long l1() default (long) 42 > long l2() default 42 as long > short s1() default (short) 42 > short s2() default 42 as short > float f1() default (float) 42 > float f2() default 42 as float > double d1() default (double) 42 > double d2() default 42 as double > } > print A.getMethod('i1').defaultValue​ > {code} > Long, Float and Double defaults cannot currently be specified in this manner. > See also GROOVY-6025 -- This message was sent by Atlassian Jira (v8.20.10#820010)