Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.8-rc-2, 1.9-beta-1
-
Component/s: None
-
Labels:None
-
Number of attachments :
Good counter example from Cédric Champeau on the mailing list:
In Groovy (and generally in a dynamically typed language), as far as I know, there's no reason why the return value should be the same type of the injected value. Here's a simple example :
(1..10).inject(1)
{ x,y -> x/y }1 is an int, but the result of the injection will be a BigDecimal.