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

SC: closure with variadic parameter

    XMLWordPrintableJSON

    Details

      Description

      Consider the following:

      @groovy.transform.CompileStatic
      void test() {
        def c = { ... zeroOrMore -> return 'foo' + zeroOrMore }
        assert c('bar', 'baz') == 'foo[bar, baz]'
        assert c('bar') == 'foo[bar]'
        assert c() == 'foo[]'
      }
      test()
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                emilles Eric Milles
                Reporter:
                emilles Eric Milles
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: