Hi,
I've been playing with generics and I was wondering if anyone could
tell me why the following doesnt work, and if there is another way to
do it
public class A<Twhere T : B, new() {
public B Get() {
B b = new B();
b.X = this;
return b;
}
}
public class B {
public A<BX { set { } }
}
basicaly class A<Tknows that T is inherited from type B, but type B
contains a property X of type A<Band I'd like to be able to set this
property from class A<T>, which I would have though should work since
the compiler knows T is of type B, I cant even cast this to A<Bas a
workaround.
Any help appreciated