Possible Duplicate:
Function overloading by return type?
If I have two methods:
myClass mc = new myClass();
double d = mc.GetPoint();
int i = mc.GetPoint();
Why cannot the C# or C++ compilers differentiate these functions from their return type? I would have though the return type would be开发者_开发问答 part of the signature of the method, just like any method arguments are.
Why can't the compilers handle this?
C# supports dynamic typing like when you use var
. How then is the compiler supposed to know which method it should call?
精彩评论