P
pitdog
This may not be the group to post this in. However I will try...
I am interested in how the .NET runtime actually handles casting. For
instance...
This will work if you assume ChildProduct is a derived class of
BaseProduct.
BaseProduct product= new ChildProduct();
However this will not work because you can't downcast.
ChildProduct = new BaseProduct();
I understand it conceptually. It will fail because there is no
guarantee that BaseProduct shares the same interface as ChildProduct.
However how does it actually check? Does it use reflection to look at
the public interfaces and make decision on that? I would really like to
know the details of how this works..
Any insight?
PD
I am interested in how the .NET runtime actually handles casting. For
instance...
This will work if you assume ChildProduct is a derived class of
BaseProduct.
BaseProduct product= new ChildProduct();
However this will not work because you can't downcast.
ChildProduct = new BaseProduct();
I understand it conceptually. It will fail because there is no
guarantee that BaseProduct shares the same interface as ChildProduct.
However how does it actually check? Does it use reflection to look at
the public interfaces and make decision on that? I would really like to
know the details of how this works..
Any insight?
PD