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

Support spread method arguments for iterable, iterator and stream

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0.13
    • 5.0.0-alpha-7
    • None
    • None

    Description

      In a Spock test case, I am trying to merge the e-mail addresses for two test users, where emails is of declared type java.util.Set:

      methodCall([*BOB.emails, *BRAD.emails])
      

      I expected the spread to inline the values, but instead I get

      java.lang.IllegalArgumentException: cannot spread the type java.util.LinkedHashSet with value [bob@corp.test]
      

      Attachments

        Activity

          People

            emilles Eric Milles
            chrylis Christopher Smith
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: