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

[Parrot] error for enum constant with comma followed by method

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.0.0-rc-1
    • None
    • parser-antlr4

    Description

      Consider the following:

      enum Orientation {
        LANDSCAPE, PORTRAIT,
        
        @Override
        String toString() {
           name().toLowerCase().capitalize()
        }
      }
      
      println Orientation.values()
      

      Parser error "unexpected token" for comma after PORTRAIT. Remove comma and no issue. Parsers support enum with trailing comma (no class members).

      See also GROOVY-4438 and GROOVY-8507

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              emilles Eric Milles
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: