groovy
  1. groovy
  2. GROOVY-5118

Make TupleConstructor work with enums

    Details

    • Type: Improvement Improvement
    • Status: Closed 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
    • Number of attachments :
      0

      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

          People

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

            Dates

            • Created:
              Updated:
              Resolved: