R
Ron Bullman
Mårten,
According "Liskovs Substitutable Principle" you can use B instead of A, but
the opposite is not true. You can't use A instead of B and this is exactly
what happening with
Of course you could provide this information to the compiler, but the bigger
question emerges then in what circumstances should you do so? (Can you
provide an example when such twist is needed?)
Ron
The "polymorphic rules" don't apply because the situation is different.The polymorphic rules that applied in the first case don't apply now for
some strange reason.
According "Liskovs Substitutable Principle" you can use B instead of A, but
the opposite is not true. You can't use A instead of B and this is exactly
what happening with
Compiler dosen't have any idea how to convert (cast) A to B.GetBAsOutParameter(out a); //DOES NOT COMPILE!!!
Of course you could provide this information to the compiler, but the bigger
question emerges then in what circumstances should you do so? (Can you
provide an example when such twist is needed?)
Ron