History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRAILS-2659
Type: Bug Bug
Status: Open Open
Priority: Minor Minor
Assignee: Graeme Rocher
Reporter: David Smiley
Votes: 0
Watchers: 1
Operations

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

Calling a method with typed params including Class doesn't work

Created: 18/Mar/08 03:32 PM   Updated: 18/Mar/08 03:32 PM
Component/s: None
Affects Version/s: 1.0.1
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments: 1. Zip Archive BugClassParamNoDispatch-bug-report-18032008.zip (38 kb)

Environment: I believe this affected grails 1.0RC1 too. It didn't affect grails 0.6. Note the groovy language differed between these releases.

Testcase included: yes


 Description  « Hide
See the testcase. If you've got a taglib closure and say you want to call a convenience method in the taglib that is not a tag. That convenience method is not a closure, just a regular instance method. And lets say in Java style you decided to type the parameters to this convenience method to make it clear what the type is. And lets say one of the parameters is of type Class. If you try to call the method, you'll get an error saying that, basically, no method was found matching the signature. If you untype the parameter declaration for the method, or don't use Class (other types seem to work), it'll work. It'll also work if the method is static.

This is an odd bug, and I suspect (though don't know) the behavior occurs for Controllers too.

I worked around this by removing the type info from the parameter declaration. Despite it being easy, it took me quite a long time to find the problem.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
There are no comments yet on this issue.