Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Not A Bug
-
Affects Version/s: 1.6-beta-1
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Testcase included:yes
-
Number of attachments :
Description
Based on GROOVY-3006 (http://jira.codehaus.org/browse/GROOVY-3006), I'd expect this to work:
void custom(Map args, Object base, Object[] varargs, def body) {
println args.dump()
println base.dump()
println varargs.dump()
body()
}
custom(Integer.class, 1, 2, 3, 4, 5, foo:"Bar", baz:42) {
println "Ran the body!"
}
However, this explodes with the following error:
groovy.lang.MissingMethodException: No signature of method: Script2.custom() is applicable for argument types: (java.util.LinkedHashMap, java.lang.Class, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, Script2$_run_closure1) values: {[foo:Bar, baz:42], class java.lang.Integer, 1, 2, 3, 4, 5, Script2$_run_closure1@c5200a}
Changing the signature to "void custom(Map args, Object base, Object[] varargs, Closure body)" doesn't help, either.
See GROOVY-30006 and http://groovy.codehaus.org/Extended+Guide+to+Method+Signatures