Skip to content

Type inferencing of overloaded property setter #801

@eric-milles

Description

@eric-milles

Consider the following:

class Foo {
  void setBar(Date value) { ... }
  void setBar(int value) { ... }
  def getBar() { ... }
  Foo() {
    bar = 1
    bar = null
    bar = new Date()
    def barValue = bar
  }
}

Code hover (F2) should display "setBar(int)" for bar in "bar = 1" and "setBar(Date)" for "bar = null" and "bar = new Date()". Currently the first setter overload is chosen for all cases. "def barValue = bar" should still infer to "getBar()".

All the same should hold for "this.bar" property expression instead of "bar" variable expression.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions