Can I somehow have overloaded methods which differ only by generic type constraints?
This does not compile:
void Foo(T bar) wh
An update. In C# 7.3 generic constraints are now part of overload decision.
So, this code will compile:
class Animal { }
class Mammal : Animal { }
class Giraffe : Mammal { }
class Reptile : Animal { }
static void Foo(T t) where T : Reptile { }
static void Foo(Animal animal) { }
static void Main()
{
Foo(new Giraffe());
}