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

Incorrect property handling for records

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 4.0.12
    • record
    • None

    Description

      While it is not normal to override record component getters, it is perfectly allowable.

       

      The following record is getting both an "x()" method and a "getX()" method. The supplied "x()" method isn't being associated correctly with the property.

      record Foo(String x, String y) {
          String x() {
              'z'
          }
      } 

      Attachments

        Activity

          People

            paulk Paul King
            paulk Paul King
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: