Skip to content

Fix type inferencing and code navigation for named-argument constructor invocation #1473

@eric-milles

Description

@eric-milles

Consider the following:

class Pogo {
  Pogo() { }
  Pogo(obj) { }
  Pogo(Map map) { }
  // property declaration(s)
}
def pogo = new Pogo(foo: bar)
  1. Since a map-based constructor is declared, the constructor invocation is satisfied by Pogo(Map). Currently the no-arg constructor is (sometimes) selected.
  2. If Pogo(Map) declaration is removed, the constructor invocation often fails to resolve to the no-arg variant -- due to the declaration of an additional constructor signature. This results in no hover or navigation for the type name.
  3. In the presence of Static Type Checking, the selected constructor (DIRECT_METHOD_CALL_TARGET metadata) is not considered, so the default dynamic resolution determines the applicable constructor.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions