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

Incorrect access of protected fields in parent classes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.1-rc-2
    • 1.1-rc-3
    • class generator
    • None

    Description

      Currently, protected fields (accessed within a constructor?) don't access the appropriate parent fields:

      class Base {
        protected aField = 'Frodo'
      }
      
      class Client extends Base {
        protected aField = super.aField + ' Baggins'
        def foo() { println "aField  : ${aField}" }
      }
      
      new Client().foo() // => aField  : null Baggins
      

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            paulk Paul King
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: