Bug 6713 - Find references of a method returns incorrect overloads
Summary: Find references of a method returns incorrect overloads
Alias: None
Product: Xamarin Studio
Classification: Desktop
Component: C# Binding ()
Version: Trunk
Hardware: PC Linux
: Low normal
Target Milestone: ---
Assignee: Mike Krüger
Depends on:
Reported: 2012-08-27 16:41 UTC by Andres G. Aragoneses
Modified: 2012-10-19 05:18 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Andres G. Aragoneses 2012-08-27 16:41:47 UTC
Steps to reproduce:
Given this code below:

namespace Bar {
	class Program {
		static void Main(string[] args) {
			Foo(new Program());

		void Foo (Program program) {

		void Foo (int integer) {

1. Right click on the first "Foo" -> find references.
Current results: 3 results.
Expected results: 2 results.

It should only return the Foo overload that takes a Program, not int.

In cases in which Foo has a lot of overloads, and there are a lot of calls to Foo, it's very annoying when you're trying to find the exact call to a specific overload, instead to see thousands of calls that don't apply. Exploring what the code does (by checking out the callers of something specific) is much harder because of this bug.
Comment 1 Andres G. Aragoneses 2012-08-27 16:43:39 UTC
1st step to reproduce should read "on the second Foo", not "on the first".

Although maybe the first Foo is also a valid scenario.
Comment 2 Mike Krüger 2012-08-28 00:40:35 UTC
Atm this is a feature - we find the 'family' - which means all overloads.

Maybe I'll add 2 commands find exact reference / find all references ?
Comment 3 Mike Krüger 2012-08-29 06:00:01 UTC
Do you like the idea to split the commands ?

VS.NET opens a dialog box and asks if all overaloads should be searched or not btw.
Comment 4 Andres G. Aragoneses 2012-08-29 07:00:03 UTC
Yes, splitting the commands sounds good.

I think the ideal thing would be:
- Find references: just looks for the particular overload.
- Find all references: looks for all overloads (this option would only appear when the element to look for has more than 1 overload).
Comment 5 Andres G. Aragoneses 2012-08-29 07:00:34 UTC
(This way we avoid the dialog box, which I think would be kind of annoying)
Comment 6 Mike Krüger 2012-10-19 05:18:32 UTC