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

If superclass defines a readonly property, subclass may not use a private field of the same name

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.2
    • 2.0.4
    • Static Type Checker
    • None

    Description

      The following code fails because the type checker things "testClass" is a readonly property:

      class Top {
          Class getTestClass() {}
      }
      
      @groovy.transform.TypeChecked
      class Bottom extends Top {
          private Class testClass
          Bottom(Class foo) {
              this.testClass = foo
          }
      }
      

      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: