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

SC: cross-package protected field access uses dynamic property methods

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 4.0.0-alpha-1, 2.5.13, 3.0.6
    • 3.0.7, 4.0.0-alpha-2, 2.5.15
    • None
    • None

    Description

      Consider the following:

      package p
      class A {
        protected int x
      }
      
      package q
      @groovy.transform.CompileStatic
      class B extends A {
        int m() { return x }
      }
      

      In this case (or if x is static), the compiler writes calls to dynamic property methods. This should be a direct field read.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h