Skip to content

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

@aromaa

Description

@aromaa

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 CommunityToolkit.HighPerformance@8.4.0
// #: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
  • 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐛An unexpected issue that highlights incorrect behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions