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

Other Operators section of Groovy docs missing get/set dot operator

    XMLWordPrintableJSON

Details

    • Documentation
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • None
    • None
    • Documentation
    • None

    Description

      Section 1.2.8 (Other Operators: http://docs.groovy-lang.org/latest/html/documentation/#_other_operators) mentions the Call Operator (aka call method). But I do not see mention of the get(name) and set(name,value) methods that lead to a "dot" operator overload as it is mentioned in Groovy in Action.

      Example (Call and Dot operator overloads):

      class General {
        def call(... args) {
          println "Called with args: $args"
        }
        def get(String name) {
          println "Getting property: $name"
        }
        void set(String name, Object value) {
          println "Setting property: $name"
        }
      }
      
      General g = new General()
      g.unknown
      g.unknown = ''
      g("1", "2")
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            emilles Eric Milles
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: