
| Key: |
GROOVY-3009
|
| Type: |
Bug
|
| Status: |
Closed
|
| Resolution: |
Not A Bug
|
| Priority: |
Minor
|
| Assignee: |
Unassigned
|
| Reporter: |
Robert Fischer
|
| Votes: |
0
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
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.
|
|
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. |
Show » |
Sort Order:
|
See GROOVY-30006 and http://groovy.codehaus.org/Extended+Guide+to+Method+Signatures