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

Make TupleConstructor work with enums

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: 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
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: