Why is intellisense not showing the appropriate methods according to what I am going through?

Like the three methods:

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

      

And if I pass in a double variable, it should automatically jump to method # 2 instead of scrolling down to see if there is a method that receives a double, right?

+1


source to share


1 answer


I can think of two reasons. First, Intellisense would need to be aware of implicit conversion rules and the like, and ultimately be as smart as the compiler. They probably just decided that the simple implementation was good enough (imagine cases more complex than yours, such as passing the results of a function directly to another function). Also, I think it would be frustrating if Intellisense hid the specific overload I wanted to call (because the argument might have been of the wrong type) - I would rather end up writing the code with the function I want and then return and fix any mistakes.



0


source







All Articles