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

        Hide
        Andrew Eisenberg added a comment -

        This is implemented locally. Now, just need to write some tests for it.

        Show
        Andrew Eisenberg added a comment - This is implemented locally. Now, just need to write some tests for it.
        Hide
        Andrew Eisenberg added a comment -

        committed with regression tests

        Show
        Andrew Eisenberg added a comment - committed with regression tests
        Andrew Eisenberg made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Andrew Eisenberg made changes -
        Component/s Inferencing Engine [ 14687 ]
        Component/s Code Browsing [ 13143 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: