Question

Like there are 3 methods like:

Modify ( int arg )
Modify ( double arg )
Modify ( string arg )

And if I am passing in a double variable, it should automatically navigate to method #2, instead of me scrolling down to see if there is a method that gets a double, right?

Was it helpful?

Solution

I can think of two reasons. First, Intellisense would have to then be aware of implicit conversion rules and the like, and end up being about as smart as the compiler. They probably just decided that the easy implementation was good enough (imagine cases more complicated than yours - e.g. passing function results directly to another function). Also, I think it would be annoying if Intellisense hid the particular overload that I wanted to call (because maybe an argument had the wrong type) - I'd rather finish writing the code with the function I want, and then go back and fix any errors.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top