Why don\'t more mainstream statically typed languages support function/method overloading by return type? I can\'t think of any that do. It seems no less useful or reasona
If functions were overloaded by the return type and you had these two overloads
int func();
string func();
there is no way the compiler could figure out which of those two functions to call upon seeing a call like this
void main()
{
func();
}
For this reason, language designers often disallow return-value overloading.
Some languages (such as MSIL), however, do allow overloading by return type. They too face the above difficulty of course, but they have workarounds, for which you'll have to consult their documentation.