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

Breaking change in enum syntax

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.7.3
    • 1.7.4, 1.8-beta-1
    • Compiler
    • None

    Description

      The following code compiles in 1.7.2, but not in 1.7.3:

      private enum EnumWithToString {
        VALUE
        String toString() { "I'm a value" }
      }
      

      groovyc output:

      unexpected token: VALUE @ line 337, column 3.
           VALUE
           ^
      
      1 error
      

      The compile error goes away when adding a semicolon after "VALUE".

      Attachments

        Activity

          People

            paulk Paul King
            pniederw Peter Niederwieser
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: