Skip to content

IDictionary does not inherit from IReadOnlyDictionary #55487

Closed as not planned
Closed as not planned
@wdnijdam

Description

@wdnijdam

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ✔️ Resolution: DuplicateResolved as a duplicate of another issueStatus: Resolvedneeds-area-labelUsed by the dotnet-issue-labeler to label those issues which couldn't be triaged automatically

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions