GRECLIPSE
  1. GRECLIPSE
  2. GRECLIPSE-916

[inferencing] Inferencing inside of closure should replace the type of 'this'

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.1.0Release
    • Fix Version/s: 2.1.1Release
    • Component/s: Inferencing Engine
    • Labels:
      None
    • Number of attachments :
      0

      Description

      A common idiom in Groovy is to change the owner of a closure to the object that is invoking it. For example:

      new Foo().run {
        someMethod()
      }
      

      Typically, the closure that is passed to run() will have its owner changed to an object of type Foo. That means someMethod() is really this.someMethod(), which is invoked on a Foo object.

      I think this is a strong enough convention that we can encode this in the inferencing engine.

        Activity

          People

          • Assignee:
            Andrew Eisenberg
            Reporter:
            Andrew Eisenberg
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: