It looks like a weird design choice, because a Dictionary
and an ImmutableDictionary
are quite different write-wise. (Read-wise, they both implement IReadOnlyDictionary
, which is fine*)
In fact, the current implementation of IDictionary<TKey, TValue>.Add()
in the ImmutableDictionary
class throws a NewSupportedException
.
So, what was the point in doing this? If a method returns an IDictionary
that is in fact an ImmutableDictionary
, you're going to have some troubles when adding elements in it, for instance.
*except for the name of the interface, which is subject to debate