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

SC: outer class field and self dynamic property

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.0.0-alpha-8
    • None
    • Static compilation
    • None

    Description

      The test case described in GROOVY-10985 fails to execute as expected under static compilation if a single reference to the private outer class field is introduced.

      @groovy.transform.CompileStatic
      class Outer {
        private static int VALUE = 1
        static class Inner {
          def getProperty(String name) {
            if (name == "VALUE") return 2
          }
          void test() {
            if (Outer.VALUE > 0) print 'positive' // creates private access bridge
            print VALUE // classgen now targets private access bridge
          }
        }
      }
      new Outer.Inner().test()
      

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated: