Issue Details (XML | Word | Printable)

Key: GROOVY-1961
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Paul King
Reporter: Paul King
Votes: 0
Watchers: 0
Operations

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

sum() should not assume the items are numbers or strings but apply normal duck typing

Created: 30/Jun/07 09:21 PM   Updated: 30/Jun/07 10:18 PM
Component/s: None
Affects Version/s: 1.1-beta-1
Fix Version/s: 1.1-beta-2

Time Tracking:
Not Specified


 Description  « Hide
sum() currently assumes that the items being summed are all numbers or strings.
def list1 = [1, 2]
def list2 = [3, 4]
def list3 = [5, 6]
[list1, list2, list3].sum() currently produces the string "[1, 2][3, 4][5, 6]"
it should produce the list [1, 2, 3, 4, 5, 6] which is what
list1 + list2 + list3 produces.

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