The IDictionary<TKey, TValue>
in .NET 4 / Silverlight 4 does not support covariance, i.e. I can't do a
IDictionary<string, object> myDict = new Dictionary<string, string>();
analog to what I can do with IEnumerable<T>
s now.
Probably boils down to the KeyValuePair<TKey, TValue>
not being covariant either. I feel that covariance should be allowed in dictionaries at least for the values.
So is that a bug or a feature? Will it ever come, maybe in .NET 37.4?