Unable to cast .Net ConcurrentDictionary<K,V> to IReadOnlyDictionary<K,V> interface?

Viewed 823

I must be missing something and feel like I have to go back to the very basics but according to the reference sources for ConcurrentDictionary in .Net 4.5 it implements the IReadOnlyDictionary interface (albeit some members explicitely), but for some reason I cannot cast an instance to that interface - why is that?

IDictionary<int, string> a = new ConcurrentDictionary<int, string>(); // works
IReadOnlyDictionary<int, string> b = new ConcurrentDictionary<int, string>(); // does not work

.. why is that?

To make this a bit more clear:

enter image description here

2 Answers
Related