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

Static compiler does not always make direct method call for getProperty in an inner class

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.1
    • 2.3.2
    • None
    • None

    Description

      In the following snippet of code:

      @groovy.transform.CompileStatic
      class Outer {
          String outerProperty = 'outer'
          private class Inner {
              String fromInner() {
                  Holder holder = new Holder()
                  holder.value = outerProperty
                  holder.value
              }
          }
      
          String blah() {
              new Inner().fromInner()
          }
      }
      

      access to "outerProperty" is done through GroovyObject.getProperty but a direct method call can be done.

      Attachments

        Activity

          People

            melix Cédric Champeau
            melix Cédric Champeau
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: