I don’t understand why IList implements IEnumerable taking in consideration that IList implements ICollection that implements IEnumerable also.
I don’t understand why IList implements IEnumerable taking in consideration that IList implements ICollection
Share
I assume you want to know why it declares that it implements
ICollectionas well asIEnumerable, when the first implies the second. I suspect the main reason is clarity: it means people don’t need to look back toICollectionto check that that already extendsIEnumerable.There are other times when you need to redeclare an interface implementation, if you want to re-implement an interface method which was previously explicitly implemented in a base class – but I don’t think that’s the reason in this case.
EDIT: I’ve been assuming that the source code that the docs are built from has the declaration including both interfaces. Another possible alternative is that all interfaces in the hierarchy are automatically pulled in by the doc generator. In which case the question becomes ‘why does the doc generator do that’ – and the answer is almost certainly still ‘clarity’.