An even simpler objection - imagine that instead of Foo it was, say, List .
By converting List<T> to List<IWorld> , I can now add another IWorld implementation IWorld (for example, type T2 ) to a list that is limited to only containing objects of type T This does not have to be reliable.
So, back to your Foo object - if it contains any methods that are expected to be called with objects of type T , now I can call them any object that implements IWorld - even if (imagine an additional Foo type) that the object is not would be a suitable type for Foo .
My point in the comments is re: type values. Again, this might be easier if we speak in terms of List<T> - a List<T> for value types containing value types without a box. If you want to use the List<IWorld> the same values, each value must be boxed before it is added to the list.
Damien_The_Unbeliever
source share