Groovy
  1. Groovy
  2. GROOVY-5118

Make TupleConstructor work with enums

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.4, 2.0-beta-1
    • Component/s: None
    • Labels:
      None

      Description

      The intent would be to make the following example work. Currently the TupleConstructor annotation is ignored and unless an explicit constructor is added, the example will fail.

      @groovy.transform.TupleConstructor
      enum Operator {
          PLUS('+'), MINUS('-')
          String symbol
      }
      
      assert Operator.PLUS.next() == Operator.MINUS
      

        Activity

        Mark Thomas made changes -
        Reporter Paul King [ paulk@asert.com.au ] Paul King [ paulk ]
        Mark Thomas made changes -
        Workflow jira [ 12974032 ] Default workflow, editable Closed status [ 12981188 ]
        Mark Thomas made changes -
        Project Import Mon Apr 06 02:11:23 UTC 2015 [ 1428286283443 ]
        Mark Thomas made changes -
        Workflow jira [ 12734042 ] Default workflow, editable Closed status [ 12745848 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 13:32:57 UTC 2015 [ 1428240777691 ]
        Paul King made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Paul King made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Fix Version/s 2.0-beta-1 [ 17925 ]
        Fix Version/s 1.8.4 [ 17852 ]
        paulk@asert.com.au created issue -

          People

          • Assignee:
            Paul King
            Reporter:
            Paul King
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development