Skip to content

[BUG] Index type ambiguity with InternalsVisibleTo and Microsoft.Bcl.Memory #513

@alastairlundy

Description

@alastairlundy

Describe the bug

When using a dependency that relies on Microsoft.Bcl.Memory or using Microsoft.Bcl.Memory directly, a type conflict occurs where both Polyfill and Microsoft.Bcl.Memory provide versions of Index and Polyfill forwards it's type to a package that has a dependency on Microsoft.Bcl.Memory.

Image

I haven't tested this with the Range type but presumably this also occurs since Microsoft.Bcl.Memory also provides ```Range``.

If I may be so bold, I would suggest considering removing Index and Range from Polyfill in a future major version since it is provided by a Microsoft Bcl NuGet package for .NET Standard 2.0.

Minimal Repro

Attached a minimal repro:

MinimalReproDependent.zip

Submit a PR that fixes the bug

I've created a PR that I believe fixes this (#512) by adding a PolyIndexAndRange feature toggle that is set to true by default, and removes the Index And Range types from compilation if set to false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions