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

Key: GROOVY-2549
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alex Tkachman
Reporter: Jim White
Votes: 0
Watchers: 0
Operations

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

Expression with "as int" fails (regression)

Created: 28/Jan/08 04:48 AM   Updated: 28/Jan/08 08:07 AM
Component/s: None
Affects Version/s: 1.5.2
Fix Version/s: 1.5.2

Time Tracking:
Not Specified

File Attachments: 1. File Groovy2549Bug.groovy (0.3 kb)


Testcase included: yes


 Description  « Hide
Expressions that contain an "as int" where the type is some built-in type (as opposed to a named class) fail.

For example, whereas "1 + (2 as int)" used to work, in the 1_5_X branch it nows throws:

No signature of method: java.lang.Integer.plus() is applicable for argument types: (java.lang.Integer) values: {2}



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jim White - 28/Jan/08 04:55 AM
Test case with this JIRA number in it.

Jim White - 28/Jan/08 05:08 AM
In the numerous permutations I've tried I've incidentally found that this failure does not currently occur in the SVN trunk, so it is something that exists only on the 1_5_X branch and created between 1.5.1 and r10590.

Jochen Theodorou - 28/Jan/08 06:10 AM
yes, that's one of these wtf?! problems... After looking a bit into it I see that the parameter 2 ha the type int, so all is good so far, but then the MetaClass fails to recognize that int can be boxed into a Number.

Guillaume Laforge - 28/Jan/08 08:07 AM
Alex told me earlier that he fixed the problem in the 1.5.x branch.
I'm closing the issue.