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

trait property throws MissingPropertyException when read using qualified super expression

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.0.0-alpha-1, 3.0.6
    • Component/s: None
    • Labels:
      None

      Description

      Consider the following:

      trait T {
        String string = 'value'
      }
      
      class C implements T {
        void meth() {
          println T.super.string
        }
      }
      
      new C().meth()
      

      Executing this script results in "MissingProipertyException: No such property: super for class: T". The property can be read using "string", "this.string", "getString()", "this.getString()" and "T.super.getString()". And the property can be written using property notation, setter call, as well as "T.super.string = 'whatever'".

      org.codehaus.groovy.transform.trait.SuperCallTraitTransformer lacks a transformation for property read access.

        Attachments

          Activity

            People

            • Assignee:
              emilles Eric Milles
              Reporter:
              emilles Eric Milles
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m