Scenario:
class A { }
class B : A { }
class C where T: A { }
Question
Why cant C<
Use co-variant if you need to do this, and because co-variant just work only with interface and delegate, so define an interface with the magic word out instead of class:
interface IC where T : A
{
}
So, you can assign like you want:
class CA : IC
{}
class CB : IC
{ }
IC x = new CA();
IC y = new CB();
x = y;