Issue Details (XML | Word | Printable)

Key: GROOVY-3009
Type: Bug Bug
Status: Closed Closed
Resolution: Not A Bug
Priority: Minor Minor
Assignee: Unassigned
Reporter: Robert Fischer
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
groovy

Can't Use a Closure with Method Reordering

Created: 19/Aug/08 07:36 AM   Updated: 12/Oct/08 08:49 AM   Resolved: 19/Aug/08 09:52 AM
Component/s: None
Affects Version/s: 1.6-beta-1
Fix Version/s: None

Time Tracking:
Not Specified

Testcase included: yes


 Description  « Hide

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.



Robert Fischer added a comment - 19/Aug/08 09:52 AM

Robert Fischer added a comment - 19/Aug/08 09:53 AM