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

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.4
    • Component/s: Static Type Checker
    • Labels:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: