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

Enum property access not working with @CompileStatic

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.4.12
    • 2.4.13
    • Static compilation
    • None

    Description

      import groovy.transform.CompileStatic
      
      enum Foo { }
      
      @CompileStatic
      def test() {
        println Foo.getModifiers() // => 16401 // ENUM | FINAL | PUBLIC (see GROOVY_8360 wrt STATIC)
        println Foo.modifiers      // java.lang.NoSuchFieldError: modifiers
      }
      
      test()
      

      Attachments

        Issue Links

          Activity

            People

              shils Shil Sinha
              paulk Paul King
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: