Skip to content

Fix type inferencing for Closure-specific methods and properties #809

@eric-milles

Description

@eric-milles

Consider the following:

class Foo {
  def xxx
  class Bar {
    def xxx
  }
  class Baz {
    def xxx
  }

  void meth() {
    new Bar().with {
      new Baz().with {
        xxx // refers to Baz.xxx
        owner.xxx refers to Bar.xxx
        getOwner().xxx // refers to Bar.xxx
        owner.owner.xxx // refers to Foo.xxx
        getOwner().getOwner().xxx // refers to Foo.xxx
        this.xxx // refers to Foo.xxx
        thisObject.xxx // refers to Foo.xxx
        getThisObject().xxx // refers to Foo.xxx
      }
    }
  }
}

With the nested closures, type inferencing of expressions like "owner.owner.xxx" breaks down and "xxx" is shown as underlined (unknown). These can be generated from content assist now (see #803 and #364) so they should infer correctly once inserted to avoid confusion.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions