Generic type inference is the ability the compiler has to infer the data type when you invoke a generic method without specify the generic type argument.
A good and simple example is demonstrated below:
private void MyGenericMethod<T>(T n1)
The method above accepts a parameter that is from the same generic type than the argument expected. You may invoke this method using the following syntax:
Yes, it compiles and executes properly. The condition to make this possible is to have at least one parameter from the same type than the generic argument. You cannot use the same logic based on the return type of a method. Take a look on the snippet below:
private T MyGenericMethod<T>()
You will not be able to invoke this method using the following syntax:
int n = MyGenericMethod(); // Compiler error