dotnet icon indicating copy to clipboard operation
dotnet copied to clipboard

Overload resolution picks Toolkit's `Span<T>` extensions over BCL in .NET 10

Open aromaa opened this issue 3 months ago • 0 comments

Describe the bug

The BCL has included ORPA for its Span<T> overloads in the MemoryExtensions, causing it to have lower priority than the Toolkit's overload.

Regression

Yes, from .NET 9.

Steps to reproduce

#:package [email protected]
// #:property TargetFramework=net10.0
#:property TargetFramework=net9.0

using CommunityToolkit.HighPerformance;

Span<int> test = [5, 4, 3, 2, 1, 0];

// 5 on .NET 9
// -1 on .NET 10
Console.WriteLine(test.IndexOf(0));

Expected behavior

The BCL's MemoryExtensions is picked.

Screenshots

No response

IDE and version

Other

IDE version

No response

Nuget packages

  • [ ] CommunityToolkit.Common
  • [ ] CommunityToolkit.Diagnostics
  • [x] CommunityToolkit.HighPerformance
  • [ ] CommunityToolkit.Mvvm (aka MVVM Toolkit)

Nuget package version(s)

8.4.0

Additional context

No response

Help us help you

No, just wanted to report this

aromaa avatar Nov 11 '25 22:11 aromaa