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

last enum value is hidden if annotated

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.10, 2.4.1
    • Fix Version/s: 2.4.6
    • Component/s: None
    • Labels:
      None
    • Environment:
      Windows 7
      First seen in Eclipse Luna (which also doesn't syntax highlight it well)

      Description

      When I annotate the final enum value in an enum, the enum value is no longer part of the enum, eg, running this via GroovyShell throws MissingPropertyException on the last line:

      @Target([ElementType.FIELD])
      @interface Fooann {
      }
      
      enum Foonum {
          @Fooann
          X,
          @Fooann // all is well if either (a) this annotation is removed,
          Y       // or (b) this value has a trailing comma
      }
      
      class Bar {
          Foonum foonum
      }
      
      println Foonum.X
      println Foonum.Y
      

        Attachments

        1. bug1.groovy
          1.0 kB
          simon misys

          Issue Links

            Activity

              People

              • Assignee:
                shils Shil Sinha
                Reporter:
                marshals simon misys
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: