It looks to me like I am having an understanding problem with covariance in c#. If I have the following classes:
class a {
}
class b : a {
}
class A<T> where T: a {
}
class B<T> : A<T> {
}
class C : A<b> {
}
And now I do:
A<a> t1 = new B<b>();
A<a> t2 = new C();
Neither of those work - but why?? Doesn't this article from Microsoft propose, that exactly this should be working? http://msdn.microsoft.com/de-de/library/dd799517(v=vs.110).aspx
Why isn't this very simple example not working?
Best regards