Allow C# to infer generic type parameters from return type?
What is the thinking around letting C# infer generic type params when returning from a method? I'm sure I'm not explaining this right, so let me demonstrate:
Code Snippet
static
int Foo(){
return Bar();}
static T Bar<T>(){
returndefault(T);}
It seems to me that in this case, the compiler could infer that Foo's call to Bar needs to be Bar<int>, correct? Is there a reason it doesn't allow this?
Thanks,
Michael

