Skip to content
This repository was archived by the owner on Dec 3, 2025. It is now read-only.

properly format non-generic IDictionary - #571

Merged
brettfo merged 1 commit into
dotnet:masterfrom
brettfo:dict-format
Oct 29, 2019
Merged

brettfo merged 1 commit into
dotnet:masterfrom
brettfo:dict-format

Conversation

@brettfo

@brettfo brettfo commented Oct 28, 2019

Copy link
Copy Markdown
Member

The sequence formatter was incorrectly assuming that IDictionary<TKey, TValue> necessarily implements IDictionary, which is not the case (however, IEnumerable<T> does necessarily implement IEnumerable and both IDictionary and IDictionary<TKey, TValue> implement IEnumerable, and IDictionary<TKey, TValue> implements IEnumerable<KeyValuePair<TKey, TValue>>. I won't go into the fact that IDictionary<TKey, TValue> returns ICollection<TKey> for its .Keys property and IDictionary returns ICollection for its .Keys property, but ICollection<T> doesn't implement ICollection. Clear?)

Fixes #554.

@brettfo
brettfo merged commit 4f6d89e into dotnet:master Oct 29, 2019
@brettfo
brettfo deleted the dict-format branch October 29, 2019 19:46
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Change default dictionary formatter to be IDictionary<TKey, TValue>

2 participants