public void Foo<T>(Func<T> bar)
where T: IMyInterface
{
Func<IMyInterface> func = bar;
}
It has been a while since I'd understood covariance, but shouldn't this compile?
Anything bar
can return is also an IMyInterface
. What seems to be the problem?