groovy

Expression with "as int" fails (regression)

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.2
  • Fix Version/s: 1.5.2
  • Component/s: None
  • Labels:
    None
  • Testcase included:
    yes
  • Number of attachments :
    1

Description

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}

Activity

Hide
Jim White added a comment -

Test case with this JIRA number in it.

Show
Jim White added a comment - Test case with this JIRA number in it.
Hide
Jim White added a comment -

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.

Show
Jim White added a comment - 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.
Hide
blackdrag blackdrag added a comment -

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.

Show
blackdrag blackdrag added a comment - 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.
Hide
Guillaume Laforge added a comment -

Alex told me earlier that he fixed the problem in the 1.5.x branch.
I'm closing the issue.

Show
Guillaume Laforge added a comment - Alex told me earlier that he fixed the problem in the 1.5.x branch. I'm closing the issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: