Skip to content

Remove IVT from System.Collections.Immutable #107848

Closed
@stephentoub

Description

@stephentoub

System.Collections.Immutable currently has InternalsVisibleTo to its tests. This is something we try hard to avoid. We should remove the reliance on internals from the tests and switch the tests over to referencing the reference assembly. Some of the validation can be moved to being debug-only asserts in the actual implementation. Other use of internals are purely for convenience. Other uses could be achieved via either reflection or more preferably by separating out the small amount of internals use into a separate unit tests project that builds the relevant product src into the test, ala what's done in networking tests, in regex, etc.

Fixing this will shrink the size of the product assembly (the linker will be able to trim it), will avoid future issues like #107840, will enable our analyzers that bail on IVT to work for S.C.I, and will make it more consistent with the rest of dotnet/runtime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-System.Collectionshelp wanted[up-for-grabs] Good issue for external contributorsin-prThere is an active PR which will close this issue when it is merged

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions