Details
-
Bug
-
Status: Closed
-
Critical
-
Resolution: Fixed
-
1.1-rc-3
-
None
Description
[code]
class VarArgs {
def method(Object... args)
def method(Integer... args)
{ println "method with Integer" }}
def a = new VarArgs()
a.method(1, 2, 3, 4, 5)
[/code]
1/ The above code fails with the following exception:
Caught: groovy.lang.MissingMethodException: No signature of method: VarArgsMethod.method() is applicable for argument types:
(java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer) values:
at VarArgsMethod.invokeMethod(VarArgs.groovy)
at VarArgs.run(VarArgs.groovy:14)
at VarArgs.main(VarArgs.groovy)
2/ If you change the method signatures to be Object[] and Integer[] respectively, the code still fails with the same error.
3/ If you change the method signature from Object... (or Object[]) to be a type which is not a super type of Integer (f.e. String... the
code will correctly run).