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

Make TupleConstructor work with enums

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • 1.8.4, 2.0-beta-1
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: