Skip to content

Fix type inferencing, syntax highlighting and code navigation for callable property invocation #1472

@eric-milles

Description

@eric-milles

Consider the following:

import groovy.transform.stc.*

class C {
  def call(@ClosureParams(value=FromString, options='Number') @DelegatesTo(Number) Closure spec) {
    42.with(spec)
  }
}
class Foo {
  C c = new C()
  void test() {
    c {
      println it
      println intValue()
    }
  }
}

c { ... } executes as c.call({ ... }) (see MetaClassImpl#invokePropertyOrMissing). Type inferencing fails to use call method metadata.

image

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions