Skip to content

System.Collections.Generic.IReadOnlySet<T> is internal in System.Collections.Immutable NuGet package #116920

Closed as not planned
@AgWillo

Description

@AgWillo

Description

IReadOnlySet<T> is exposed as internal if added to an assembly via the NuGet System.Collections.Immutable package (version 8.0.0+, I believe), but the interface is public in .NET 5+.

Reproduction Steps

  1. Create a project that targets, for example, .NET Framewor4 4.6.2 and add the latest version of the System.Collections.Immutable NugetPackage (9.0.6 as of this writing).
  2. Attempt to create a variable with a type of, say IReadOnlySet<string>.

Expected behavior

Per the documentation for IReadOnlySet<T> Interface, no error should be reported.

Actual behavior

The compiler raises error CS0122, 'IReadOnlySet<T>' is inaccessible due to its protection level.

Regression?

No response

Known Workarounds

No response

Configuration

This behavior appears with .NET (< 5) and .NET Framework versions that are supported by the System.Collections.Immutable NugetPackage version 9.0.6 (probably any version from 8.0.0 through 9.0.6).

Other information

My use case involves a collection that wraps FrozenSet<T> in a .NET Framework project. I'd like to expose it as IReadOnlySet<T>, but the NuGet package's implementation prevents this.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions