public T Foo<T, U>(U thing) where T : new()
{
return new T();
}
When there is no new()
constraint, I understand how it would work. The JIT Compiler sees T and if it's a reference type makes uses the object versions of the code, and specializes for each value type case.
How does it work if you have a new T() in there? Where does it look for?