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

Type checker doesn't allow property notation as LHS when only a setter exists

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.1
    • Static Type Checker
    • None

    Description

      If a class has only a setter, but no getter:

      class A {
         void setFoo(String arg) {}
      }
      

      Then the type checker doesn't allow the property notation for assignments:

      def a = new A()
      a.foo = 'bar'
      

      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: