If you write a method today, you would use something like this:
public static void Sort<T>(T[] array) where T : IComparable
This cannot guarantee that the array is not null at compile time (unfortunately), but it can guarantee that the array is of type comparable and one-dimensional. A null check should still be a runtime check.
But it depends on generics that were not added to the language before .NET 2.0. (It also uses generic method-level generators, rather than generic-level classes that were not added before .NET 3.5). Array.Sort been added to .NET 1.0. This has not been changed because it would be a terrific change that language developers prefer not to.
Servy source share