dotnet
dotnet copied to clipboard
.NET 8 source-broke ROSExtensions.Count<>
Describe the bug
Error
CS0121 The call is ambiguous between the following methods or properties: 'System.MemoryExtensions.Count<T>(System.ReadOnlySpan<T>, T)' and 'CommunityToolkit.HighPerformance.ReadOnlySpanExtensions.Count<T>(System.ReadOnlySpan<T>, T)'
after changing the TargetFramework to net8.0.
Regression
7.1.2, 8.2.2 - with .net 7
Steps to reproduce
-
dotnet new console -f net8.0 -
dotnet add package CommunityToolkit.HighPerformance - Program.cs:
using CommunityToolkit.HighPerformance;
_ = default(ReadOnlySpan<byte>).Count((byte)0);
-
dotnet build
Expected behavior
It should compile, just like with net7.0.
Screenshots
No response
IDE and version
VS 2022
IDE version
No response
Nuget packages
- [ ] CommunityToolkit.Common
- [ ] CommunityToolkit.Diagnostics
- [X] CommunityToolkit.HighPerformance
- [ ] CommunityToolkit.Mvvm (aka MVVM Toolkit)
Nuget package version(s)
8.2.2
Additional context
No response
Help us help you
No, just wanted to report this
I've encountered this as well. I wonder if this API is needed in .NET 8+ anymore, and could be omitted from compile on that target altogether.