Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDictionary does not inherit from IReadOnlyDictionary #55487

Closed
1 task done
wdnijdam opened this issue May 2, 2024 · 4 comments
Closed
1 task done

IDictionary does not inherit from IReadOnlyDictionary #55487

wdnijdam opened this issue May 2, 2024 · 4 comments
Labels
✔️ Resolution: Duplicate Resolved as a duplicate of another issue needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically Status: Resolved

Comments

@wdnijdam
Copy link

wdnijdam commented May 2, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

IDictionary is declared as

  public interface IDictionary<TKey, TValue> : 
    ICollection<KeyValuePair<TKey, TValue>>,
    IEnumerable<KeyValuePair<TKey, TValue>>,
    IEnumerable

The extension GetValueOrDefault() does not work on IDictionary because it is defined on IReadOnlyDictionary

Expected Behavior

IDictionary should implement interface IReadOnlyDictionary as well

Steps To Reproduce

Declare local variable of type IDictionary

Invoke var.GetValueOrDefault()

It cannot be resolved

Exceptions (if any)

No response

.NET Version

8.0.4

Anything else?

No response

@dotnet-issue-labeler dotnet-issue-labeler bot added the needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically label May 2, 2024
@campersau
Copy link
Contributor

See dotnet/runtime#31001

@martincostello
Copy link
Member

martincostello commented May 2, 2024

See dotnet/runtime#101469.

My bad, that was reverted.

@martincostello
Copy link
Member

Duplicate of dotnet/runtime#31001.

@martincostello martincostello added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label May 2, 2024
@mkArtakMSFT
Copy link
Member

Thanks @martincostello!

@mkArtakMSFT mkArtakMSFT closed this as not planned Won't fix, can't repro, duplicate, stale May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✔️ Resolution: Duplicate Resolved as a duplicate of another issue needs-area-label Used by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically Status: Resolved
Projects
None yet
Development

No branches or pull requests

4 participants