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

Use the Microsoft.Bcl.Memory package for the System.Index/System.Range implementation downlevel #74752

Closed
jkoritzinsky opened this issue Aug 13, 2024 · 2 comments
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@jkoritzinsky
Copy link
Member

The .NET Libraries team has recently shipped a new assembly, Microsoft.Bcl.Memory, which defines the System.Index and System.Range types for downlevel usage. Instead of having an internal System.Index and System.Range type for downlevel usage, it would be nice to use this package as it would also allow analyzers, code fixes, and source generators to use index and range-based language features by referencing (and not shipping) the Microsoft.Bcl.Memory package version that Roslyn provides (similar experience as System.Memory and System.Collections.Immutable).

This would provide a solution long-term for dotnet/runtime#104308, where we have to manually do an internal polyfill of the Index and Range types as shipping Microsoft.Bcl.Memory along with our analyzers/source-generators is extremely difficult.

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 13, 2024
@sharwell
Copy link
Member

as it would also allow analyzers, code fixes, and source generators to use index and range-based language features

This is a difficult claim to make, as each of these compiler extensibility features builds against netstandard2.0 and building with C# language version 8.0 against netstandard2.0 is not a supported scenario.

@jaredpar
Copy link
Member

Indeed. These are explicitly not supported scenarios.

@jaredpar jaredpar closed this as not planned Won't fix, can't repro, duplicate, stale Aug 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

3 participants