Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
-
OS: WindowsXP, Java: 1.6.0_11, Groovy: 1.6-RC-1
Description
When I run the following codes, I caught
java.lang.ClassCastException: java.util.ArrayList cannot be cast to java.lang.Number
at org.codehaus.groovy.reflection.stdclasses.IntegerCachedClass.coerceArgument(IntegerCachedClass.java:37)
...
def foo(int arg0, String arg1, arg2){ println arg0 println arg1 println arg2 } foo([ 1, "B", 0.5 ])
but I was able to run the next methods
def foo(Number arg0, String arg1, int arg2){...} def foo(String arg0, int arg1, int arg2){...}
I tried
Number GOOD String GOOD char GOOD Object GOOD BigInteger GOOD int BAD BigDecimal BAD float BAD byte BAD