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

super does not work for attribute lookup

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • None
    • 1.1-rc-3
    • None
    • None
    • Ubuntu Edgy + JDK 1.6 + Groovy r5589

    Description

      The code

      class Super { protected final x = [ ] }
      class Sub extends Super { protected final x ; Sub ( ) { x = super.x + [ 'a' ] } }
      
      println ( new Sub ( ).x )
      

      results in the output:

      nulla

      which implies that super.x has not bound to [] but to null. I suspect the super.x is actually referring to x in Sub.

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            russel Dr. Russel Winder
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: