This is example from "CLR via C#" book:
static void Swap<T>(ref T a, ref T b)
{
T t = b;
b = a;
a = t;
}
String s1 = "a";
String s2 = "b";
Swap(ref s1, ref s2);
Why does this compiles without specifying Swap<String>(...) What features of C# compiler or CLR allow this

Generic function without parameter
ashmag
When calling a generic method, C# allows you to omit the type argument list; if so the compiler will try to infer the type arguments. This usually works, though you can run into situations with overloaded methods where the compiler can't determine which one you want to call. In this case you'll get a compilation error and you'll need to explicitly declare the type arguments.
If you're interested, you can read all the technical details in section 20.6.3 of the C# Version 2.0 Specification.
-Tom Meschter
Software Dev, Visual C# IDE