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

enum definition does not allow trailing comma

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.5.6
    • 1.7.3, 1.8-beta-1
    • parser
    • None
    • Any

    Description

      The Groovy parser does not allow a trailing comma in an enum definition:

      enum Foo {
      X, Y, Z,
      }

      According to the Java language specification (V. 3):

      EnumDeclaration: ClassModifiersopt enum Identifier Interfacesopt EnumBody
      EnumBody: { EnumConstantsopt ,opt EnumBodyDeclarationsopt }

      Note the ",opt" in the EnumBody.

      Attachments

        1. Foo.groovy
          0.0 kB
          G. Ralph Kuntz

        Activity

          People

            paulk Paul King
            grkuntzmd G. Ralph Kuntz
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: