Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-1961

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.1-beta-1
    • 1.1-beta-2
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

            paulk Paul King
            paulk Paul King
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: