IList<T> doesn’t extend IList

Looking at these two images snapped right off MSDN, what do you notice?

image

image

.

.

.

that IEnumerable<T> extends IEnumerable but IList<T> doesn’t extend IList!?

I know, peculiar isn’t it?

 

Turns out, it was for a good reason:

"A sequence of integers can be treated as a sequence of objects, by boxing every integer as it comes out of the sequence. But a read-write list of integers cannot be treated as a read-write list of objects, because you can put a string into a read-write list of objects. An IList<T> is not required to fulfill the whole contract of IList, so it does not inherit from it."

Interesting.

  • satheesh

    Nice explanation.Thanks