Skip to content

Default parameters: wrong signature considered when invoking Call Hierarchy from a method/constructor call omitting optional parameters #776

@mauromol

Description

@mauromol

Consider this:

package test42

class GBean {

	GBean() {}
	
	GBean(String foo, String bar = 'hello') {}
	
	void doSomething() {}
	
	void doSomething(String foo, String bar = 'bar') {}
}

And this:

package test42;

class Test43 {

	void test() {
		def b2 = new GBean('foo')
		
		b2.doSomething()
		b2.doSomething('foo')
		b2.doSomething('foo', 'bar')
	}
}

Now put the cursor on:

  • doSomething on b2.doSomething('foo')
  • GBean on def b2 = new GBean('foo')

Invoke Call Hierarchy in both cases. Greclipse respectively:

  • searches for references to test42.GBean.doSomething(String), which does not exists; it should match test42.GBean.doSomething(String, String) and search references for that instead
  • searches for references to test42.GBean.GBean(String), which does not exists; it should match test42.GBean.GBean(String, String) and search references for that instead

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions