Groovy
  1. Groovy
  2. GROOVY-1543

Support multiple declarations at once: def a,b = 1,2

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6-beta-2
    • Component/s: syntax
    • Labels:
      None

      Description

      We should support multiple declarations at once:

      def a, b = 1,2

      Or more advanced

      def a, b = [1,2,3], [4,5,6]

        Issue Links

          Activity

          Graeme Rocher created issue -
          Guillaume Delcroix made changes -
          Field Original Value New Value
          Link This issue is duplicated by GROOVY-1544 [ GROOVY-1544 ]
          Guillaume Delcroix made changes -
          Assignee Guillaume Laforge [ guillaume ]
          Guillaume Delcroix made changes -
          Fix Version/s 1.1-beta-2 [ 10436 ]
          Paul King made changes -
          Link This issue is related to GROOVY-158 [ GROOVY-158 ]
          Hide
          Paul King added a comment -

          Some overlap with GROOVY-158 but not quite the same - leaving both open for now.

          Show
          Paul King added a comment - Some overlap with GROOVY-158 but not quite the same - leaving both open for now.
          Hide
          Jochen Theodorou added a comment -

          should work now

          Show
          Jochen Theodorou added a comment - should work now
          Jochen Theodorou made changes -
          Status Open [ 1 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Assignee Jochen Theodorou [ blackdrag ]
          Fix Version/s 1.6 [ 13832 ]
          Hide
          Paul King added a comment -

          Isn't that the difference between GROOVY-158 and this issue?

          Currently we allow:

          def a, b
          [a, b] = [[1,2,3], [4,5,6]]
          

          but this issue wants:

          def [a, b] = [[1,2,3], [4,5,6]]
          

          which we don't allow?

          Show
          Paul King added a comment - Isn't that the difference between GROOVY-158 and this issue? Currently we allow: def a, b [a, b] = [[1,2,3], [4,5,6]] but this issue wants: def [a, b] = [[1,2,3], [4,5,6]] which we don't allow?
          Hide
          Jochen Theodorou added a comment -

          ah, ok, didn't see that

          Show
          Jochen Theodorou added a comment - ah, ok, didn't see that
          Jochen Theodorou made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Hide
          Jochen Theodorou added a comment -

          but I doubt we can have this in 1.6

          Show
          Jochen Theodorou added a comment - but I doubt we can have this in 1.6
          Hide
          Jochen Theodorou added a comment -

          it is now

          def (a,b) = [[1,2],[3,4]]

          and

          (a,b) = [1,2]

          Show
          Jochen Theodorou added a comment - it is now def (a,b) = [ [1,2] , [3,4] ] and (a,b) = [1,2]
          Jochen Theodorou made changes -
          Fix Version/s 1.6 [ 13832 ]
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Fix Version/s 1.6-beta-2 [ 14261 ]
          Mark Thomas made changes -
          Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
          Mark Thomas made changes -
          Workflow jira [ 12730674 ] Default workflow, editable Closed status [ 12742631 ]
          Mark Thomas made changes -
          Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
          Mark Thomas made changes -
          Workflow jira [ 12969014 ] Default workflow, editable Closed status [ 12976797 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Closed Closed
          537d 1h 4m 1 Jochen Theodorou 22/Apr/08 08:13
          Closed Closed Reopened Reopened
          18h 59m 1 Jochen Theodorou 23/Apr/08 03:13
          Reopened Reopened Closed Closed
          169d 10h 27m 1 Jochen Theodorou 09/Oct/08 13:40

            People

            • Assignee:
              Jochen Theodorou
              Reporter:
              Graeme Rocher
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development