diff --git a/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs b/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs index 8e452d7e1d1e3f..24f0119fcc29cd 100644 --- a/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs +++ b/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.cs @@ -219,10 +219,12 @@ public static System.Collections.Immutable.ImmutableArray CreateRange Create(params T[]? items) { throw null; } public static System.Collections.Immutable.ImmutableArray Create(T[] items, int start, int length) { throw null; } public static System.Collections.Immutable.ImmutableArray Create(params System.ReadOnlySpan items) { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static System.Collections.Immutable.ImmutableArray Create(System.Span items) { throw null; } public static System.Collections.Immutable.ImmutableArray ToImmutableArray(this System.Collections.Generic.IEnumerable items) { throw null; } public static System.Collections.Immutable.ImmutableArray ToImmutableArray(this System.Collections.Immutable.ImmutableArray.Builder builder) { throw null; } public static System.Collections.Immutable.ImmutableArray ToImmutableArray(this System.ReadOnlySpan items) { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static System.Collections.Immutable.ImmutableArray ToImmutableArray(this System.Span items) { throw null; } } [System.Runtime.CompilerServices.CollectionBuilderAttribute(typeof(System.Collections.Immutable.ImmutableArray), "Create")] diff --git a/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.csproj b/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.csproj index 654ef839f48b06..098eeba7b3354c 100644 --- a/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.csproj +++ b/src/libraries/System.Collections.Immutable/ref/System.Collections.Immutable.csproj @@ -19,6 +19,10 @@ + + + + @@ -28,4 +32,4 @@ - \ No newline at end of file + diff --git a/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj b/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj index d2eac5d7d4577a..3f4bdabb2e37b6 100644 --- a/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj +++ b/src/libraries/System.Collections.Immutable/src/System.Collections.Immutable.csproj @@ -156,6 +156,10 @@ The System.Collections.Immutable library is built-in as part of the shared frame + + + + diff --git a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray.cs b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray.cs index 15de249335b8f3..a170f53e66f240 100644 --- a/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray.cs +++ b/src/libraries/System.Collections.Immutable/src/System/Collections/Immutable/ImmutableArray.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Diagnostics; using System.Linq; +using System.Runtime.CompilerServices; namespace System.Collections.Immutable { @@ -104,6 +105,7 @@ public static ImmutableArray Create(params ReadOnlySpan items) /// The type of element stored in the array. /// The elements to store in the array. /// An immutable array containing the specified items. + [OverloadResolutionPriority(-1)] public static ImmutableArray Create(Span items) { return Create((ReadOnlySpan)items); @@ -126,6 +128,7 @@ public static ImmutableArray ToImmutableArray(this ReadOnlySpan items) /// The type of element in the list. /// The elements to store in the array. /// An immutable array containing the specified items. + [OverloadResolutionPriority(-1)] public static ImmutableArray ToImmutableArray(this Span items) { return Create((ReadOnlySpan)items); diff --git a/src/libraries/System.Memory/ref/System.Memory.cs b/src/libraries/System.Memory/ref/System.Memory.cs index f7b1f5f48d0f78..53d3da5e0441c2 100644 --- a/src/libraries/System.Memory/ref/System.Memory.cs +++ b/src/libraries/System.Memory/ref/System.Memory.cs @@ -222,73 +222,106 @@ public static partial class MemoryExtensions public static System.Span AsSpan(this T[]? array, int start, int length) { throw null; } public static System.Span AsSpan(this T[]? array, System.Range range) { throw null; } public static int BinarySearch(this System.ReadOnlySpan span, System.IComparable comparable) { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int BinarySearch(this System.Span span, System.IComparable comparable) { throw null; } public static int BinarySearch(this System.ReadOnlySpan span, T value, TComparer comparer) where TComparer : System.Collections.Generic.IComparer, allows ref struct { throw null; } public static int BinarySearch(this System.ReadOnlySpan span, TComparable comparable) where TComparable : System.IComparable, allows ref struct { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int BinarySearch(this System.Span span, T value, TComparer comparer) where TComparer : System.Collections.Generic.IComparer, allows ref struct { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int BinarySearch(this System.Span span, TComparable comparable) where TComparable : System.IComparable, allows ref struct { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int CommonPrefixLength(this System.Span span, System.ReadOnlySpan other) { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int CommonPrefixLength(this System.Span span, System.ReadOnlySpan other, System.Collections.Generic.IEqualityComparer? comparer) { throw null; } public static int CommonPrefixLength(this System.ReadOnlySpan span, System.ReadOnlySpan other) { throw null; } public static int CommonPrefixLength(this System.ReadOnlySpan span, System.ReadOnlySpan other, System.Collections.Generic.IEqualityComparer? comparer) { throw null; } public static int CompareTo(this System.ReadOnlySpan span, System.ReadOnlySpan other, System.StringComparison comparisonType) { throw null; } public static bool Contains(this System.ReadOnlySpan span, System.ReadOnlySpan value, System.StringComparison comparisonType) { throw null; } public static bool Contains(this System.ReadOnlySpan span, T value) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool Contains(this System.Span span, T value) where T : System.IEquatable? { throw null; } public static bool ContainsAny(this System.ReadOnlySpan span, System.Buffers.SearchValues values) { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool ContainsAny(this System.Span span, System.Buffers.SearchValues values) { throw null; } public static bool ContainsAny(this System.ReadOnlySpan span, System.Buffers.SearchValues values) where T : System.IEquatable? { throw null; } public static bool ContainsAny(this System.ReadOnlySpan span, System.ReadOnlySpan values) where T : System.IEquatable? { throw null; } public static bool ContainsAny(this System.ReadOnlySpan span, T value0, T value1) where T : System.IEquatable? { throw null; } public static bool ContainsAny(this System.ReadOnlySpan span, T value0, T value1, T value2) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool ContainsAny(this System.Span span, System.Buffers.SearchValues values) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool ContainsAny(this System.Span span, System.ReadOnlySpan values) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool ContainsAny(this System.Span span, T value0, T value1) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool ContainsAny(this System.Span span, T value0, T value1, T value2) where T : System.IEquatable? { throw null; } public static bool ContainsAnyExcept(this System.ReadOnlySpan span, System.Buffers.SearchValues values) where T : System.IEquatable? { throw null; } public static bool ContainsAnyExcept(this System.ReadOnlySpan span, System.ReadOnlySpan values) where T : System.IEquatable? { throw null; } public static bool ContainsAnyExcept(this System.ReadOnlySpan span, T value) where T : System.IEquatable? { throw null; } public static bool ContainsAnyExcept(this System.ReadOnlySpan span, T value0, T value1) where T : System.IEquatable? { throw null; } public static bool ContainsAnyExcept(this System.ReadOnlySpan span, T value0, T value1, T value2) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool ContainsAnyExcept(this System.Span span, System.Buffers.SearchValues values) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool ContainsAnyExcept(this System.Span span, System.ReadOnlySpan values) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool ContainsAnyExcept(this System.Span span, T value) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool ContainsAnyExcept(this System.Span span, T value0, T value1) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool ContainsAnyExcept(this System.Span span, T value0, T value1, T value2) where T : System.IEquatable? { throw null; } public static bool ContainsAnyExceptInRange(this System.ReadOnlySpan span, T lowInclusive, T highInclusive) where T : System.IComparable { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool ContainsAnyExceptInRange(this System.Span span, T lowInclusive, T highInclusive) where T : System.IComparable { throw null; } public static bool ContainsAnyInRange(this System.ReadOnlySpan span, T lowInclusive, T highInclusive) where T : System.IComparable { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool ContainsAnyInRange(this System.Span span, T lowInclusive, T highInclusive) where T : System.IComparable { throw null; } public static void CopyTo(this T[]? source, System.Memory destination) { } public static void CopyTo(this T[]? source, System.Span destination) { } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int Count(this System.Span span, T value) where T : System.IEquatable? { throw null; } public static int Count(this System.ReadOnlySpan span, T value) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int Count(this System.Span span, System.ReadOnlySpan value) where T : System.IEquatable? { throw null; } public static int Count(this System.ReadOnlySpan span, System.ReadOnlySpan value) where T : System.IEquatable? { throw null; } public static bool EndsWith(this System.ReadOnlySpan span, System.ReadOnlySpan value, System.StringComparison comparisonType) { throw null; } public static bool EndsWith(this System.ReadOnlySpan span, System.ReadOnlySpan value) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool EndsWith(this System.Span span, System.ReadOnlySpan value) where T : System.IEquatable? { throw null; } public static bool EndsWith(this System.ReadOnlySpan span, T value) where T : System.IEquatable? { throw null; } public static System.Text.SpanLineEnumerator EnumerateLines(this System.ReadOnlySpan span) { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static System.Text.SpanLineEnumerator EnumerateLines(this System.Span span) { throw null; } public static System.Text.SpanRuneEnumerator EnumerateRunes(this System.ReadOnlySpan span) { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static System.Text.SpanRuneEnumerator EnumerateRunes(this System.Span span) { throw null; } public static bool Equals(this System.ReadOnlySpan span, System.ReadOnlySpan other, System.StringComparison comparisonType) { throw null; } public static int IndexOf(this System.ReadOnlySpan span, System.ReadOnlySpan value, System.StringComparison comparisonType) { throw null; } public static int IndexOfAny(this System.ReadOnlySpan span, System.Buffers.SearchValues values) { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int IndexOfAny(this System.Span span, System.Buffers.SearchValues values) { throw null; } public static int IndexOfAny(this System.ReadOnlySpan span, System.Buffers.SearchValues values) where T : System.IEquatable? { throw null; } public static int IndexOfAny(this System.ReadOnlySpan span, System.ReadOnlySpan values) where T : System.IEquatable? { throw null; } public static int IndexOfAny(this System.ReadOnlySpan span, T value0, T value1) where T : System.IEquatable? { throw null; } public static int IndexOfAny(this System.ReadOnlySpan span, T value0, T value1, T value2) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int IndexOfAny(this System.Span span, System.Buffers.SearchValues values) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int IndexOfAny(this System.Span span, System.ReadOnlySpan values) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int IndexOfAny(this System.Span span, T value0, T value1) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int IndexOfAny(this System.Span span, T value0, T value1, T value2) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int IndexOfAnyExcept(this System.Span span, T value) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int IndexOfAnyExcept(this System.Span span, T value0, T value1) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int IndexOfAnyExcept(this System.Span span, T value0, T value1, T value2) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int IndexOfAnyExcept(this System.Span span, System.Buffers.SearchValues values) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int IndexOfAnyExcept(this System.Span span, System.ReadOnlySpan values) where T : System.IEquatable? { throw null; } public static int IndexOfAnyExcept(this System.ReadOnlySpan span, T value) where T : System.IEquatable? { throw null; } public static int IndexOfAnyExcept(this System.ReadOnlySpan span, T value0, T value1) where T : System.IEquatable? { throw null; } @@ -296,12 +329,16 @@ public static void CopyTo(this T[]? source, System.Span destination) { } public static int IndexOfAnyExcept(this System.ReadOnlySpan span, System.Buffers.SearchValues values) where T : System.IEquatable? { throw null; } public static int IndexOfAnyExcept(this System.ReadOnlySpan span, System.ReadOnlySpan values) where T : System.IEquatable? { throw null; } public static int IndexOfAnyExceptInRange(this System.ReadOnlySpan span, T lowInclusive, T highInclusive) where T : System.IComparable { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int IndexOfAnyExceptInRange(this System.Span span, T lowInclusive, T highInclusive) where T : System.IComparable { throw null; } public static int IndexOf(this System.ReadOnlySpan span, System.ReadOnlySpan value) where T : System.IEquatable? { throw null; } public static int IndexOf(this System.ReadOnlySpan span, T value) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int IndexOf(this System.Span span, System.ReadOnlySpan value) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int IndexOf(this System.Span span, T value) where T : System.IEquatable? { throw null; } public static int IndexOfAnyInRange(this System.ReadOnlySpan span, T lowInclusive, T highInclusive) where T : System.IComparable { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int IndexOfAnyInRange(this System.Span span, T lowInclusive, T highInclusive) where T : System.IComparable { throw null; } public static bool IsWhiteSpace(this System.ReadOnlySpan span) { throw null; } public static int LastIndexOf(this System.ReadOnlySpan span, System.ReadOnlySpan value, System.StringComparison comparisonType) { throw null; } @@ -309,14 +346,23 @@ public static void CopyTo(this T[]? source, System.Span destination) { } public static int LastIndexOfAny(this System.ReadOnlySpan span, System.ReadOnlySpan values) where T : System.IEquatable? { throw null; } public static int LastIndexOfAny(this System.ReadOnlySpan span, T value0, T value1) where T : System.IEquatable? { throw null; } public static int LastIndexOfAny(this System.ReadOnlySpan span, T value0, T value1, T value2) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int LastIndexOfAny(this System.Span span, System.Buffers.SearchValues values) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int LastIndexOfAny(this System.Span span, System.ReadOnlySpan values) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int LastIndexOfAny(this System.Span span, T value0, T value1) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int LastIndexOfAny(this System.Span span, T value0, T value1, T value2) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int LastIndexOfAnyExcept(this System.Span span, T value) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int LastIndexOfAnyExcept(this System.Span span, T value0, T value1) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int LastIndexOfAnyExcept(this System.Span span, T value0, T value1, T value2) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int LastIndexOfAnyExcept(this System.Span span, System.Buffers.SearchValues values) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int LastIndexOfAnyExcept(this System.Span span, System.ReadOnlySpan values) where T : System.IEquatable? { throw null; } public static int LastIndexOfAnyExcept(this System.ReadOnlySpan span, T value) where T : System.IEquatable? { throw null; } public static int LastIndexOfAnyExcept(this System.ReadOnlySpan span, T value0, T value1) where T : System.IEquatable? { throw null; } @@ -324,25 +370,34 @@ public static void CopyTo(this T[]? source, System.Span destination) { } public static int LastIndexOfAnyExcept(this System.ReadOnlySpan span, System.Buffers.SearchValues values) where T : System.IEquatable? { throw null; } public static int LastIndexOfAnyExcept(this System.ReadOnlySpan span, System.ReadOnlySpan values) where T : System.IEquatable? { throw null; } public static int LastIndexOfAnyExceptInRange(this System.ReadOnlySpan span, T lowInclusive, T highInclusive) where T : System.IComparable { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int LastIndexOfAnyExceptInRange(this System.Span span, T lowInclusive, T highInclusive) where T : System.IComparable { throw null; } public static int LastIndexOf(this System.ReadOnlySpan span, System.ReadOnlySpan value) where T : System.IEquatable? { throw null; } public static int LastIndexOf(this System.ReadOnlySpan span, T value) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int LastIndexOf(this System.Span span, System.ReadOnlySpan value) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int LastIndexOf(this System.Span span, T value) where T : System.IEquatable? { throw null; } public static int LastIndexOfAnyInRange(this System.ReadOnlySpan span, T lowInclusive, T highInclusive) where T : System.IComparable { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int LastIndexOfAnyInRange(this System.Span span, T lowInclusive, T highInclusive) where T : System.IComparable { throw null; } public static bool Overlaps(this System.ReadOnlySpan span, System.ReadOnlySpan other) { throw null; } public static bool Overlaps(this System.ReadOnlySpan span, System.ReadOnlySpan other, out int elementOffset) { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool Overlaps(this System.Span span, System.ReadOnlySpan other) { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool Overlaps(this System.Span span, System.ReadOnlySpan other, out int elementOffset) { throw null; } public static void Replace(this System.Span span, T oldValue, T newValue) where T : System.IEquatable? { } public static void Replace(this System.ReadOnlySpan source, System.Span destination, T oldValue, T newValue) where T : System.IEquatable? { } public static void Reverse(this System.Span span) { } public static int SequenceCompareTo(this System.ReadOnlySpan span, System.ReadOnlySpan other) where T : System.IComparable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static int SequenceCompareTo(this System.Span span, System.ReadOnlySpan other) where T : System.IComparable? { throw null; } public static bool SequenceEqual(this System.ReadOnlySpan span, System.ReadOnlySpan other) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool SequenceEqual(this System.Span span, System.ReadOnlySpan other) where T : System.IEquatable? { throw null; } public static bool SequenceEqual(this System.ReadOnlySpan span, System.ReadOnlySpan other, System.Collections.Generic.IEqualityComparer? comparer = null) { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool SequenceEqual(this System.Span span, System.ReadOnlySpan other, System.Collections.Generic.IEqualityComparer? comparer = null) { throw null; } public static void Sort(this System.Span span) { } public static void Sort(this System.Span span, System.Comparison comparison) { } @@ -360,6 +415,7 @@ public static void Sort(this System.Span keys, Sy public static int SplitAny(this System.ReadOnlySpan source, System.Span destination, System.ReadOnlySpan separators, System.StringSplitOptions options = System.StringSplitOptions.None) { throw null; } public static bool StartsWith(this System.ReadOnlySpan span, System.ReadOnlySpan value, System.StringComparison comparisonType) { throw null; } public static bool StartsWith(this System.ReadOnlySpan span, System.ReadOnlySpan value) where T : System.IEquatable? { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public static bool StartsWith(this System.Span span, System.ReadOnlySpan value) where T : System.IEquatable? { throw null; } public static bool StartsWith(this System.ReadOnlySpan span, T value) where T : System.IEquatable? { throw null; } public static int ToLower(this System.ReadOnlySpan source, System.Span destination, System.Globalization.CultureInfo? culture) { throw null; } diff --git a/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs b/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs index 443d0c64b6f1a0..fd00fe8c727068 100644 --- a/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs +++ b/src/libraries/System.Numerics.Vectors/ref/System.Numerics.Vectors.cs @@ -762,6 +762,7 @@ public readonly void CopyTo(System.Span destination) { } private readonly int _dummyPrimitive; public Vector(System.ReadOnlySpan values) { throw null; } public Vector(System.ReadOnlySpan values) { throw null; } + [System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute(-1)] public Vector(System.Span values) { throw null; } public Vector(T value) { throw null; } public Vector(T[] values) { throw null; } diff --git a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.Globalization.cs b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.Globalization.cs index fac474c1b36913..5b64d503b836b8 100644 --- a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.Globalization.cs +++ b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.Globalization.cs @@ -378,6 +378,7 @@ public static SpanRuneEnumerator EnumerateRunes(this ReadOnlySpan span) /// /// Invalid sequences will be represented in the enumeration by . /// + [OverloadResolutionPriority(-1)] public static SpanRuneEnumerator EnumerateRunes(this Span span) { return new SpanRuneEnumerator(span); @@ -404,6 +405,7 @@ public static SpanLineEnumerator EnumerateLines(this ReadOnlySpan span) /// for for more information on how newline /// sequences are detected. /// + [OverloadResolutionPriority(-1)] public static SpanLineEnumerator EnumerateLines(this Span span) { return new SpanLineEnumerator(span); diff --git a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs index ce8a3a83a7fc0d..174fac083981be 100644 --- a/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs +++ b/src/libraries/System.Private.CoreLib/src/System/MemoryExtensions.cs @@ -313,6 +313,7 @@ public static ReadOnlyMemory AsMemory(this string? text, Range range) /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static unsafe bool Contains(this Span span, T value) where T : IEquatable? => Contains((ReadOnlySpan)span, value); @@ -362,61 +363,73 @@ ref Unsafe.As(ref MemoryMarshal.GetReference(span)), /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static bool ContainsAny(this Span span, T value0, T value1) where T : IEquatable? => ContainsAny((ReadOnlySpan)span, value0, value1); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static bool ContainsAny(this Span span, T value0, T value1, T value2) where T : IEquatable? => ContainsAny((ReadOnlySpan)span, value0, value1, value2); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static bool ContainsAny(this Span span, ReadOnlySpan values) where T : IEquatable? => ContainsAny((ReadOnlySpan)span, values); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static bool ContainsAny(this Span span, SearchValues values) where T : IEquatable? => ContainsAny((ReadOnlySpan)span, values); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static bool ContainsAny(this Span span, SearchValues values) => ContainsAny((ReadOnlySpan)span, values); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static bool ContainsAnyExcept(this Span span, T value) where T : IEquatable? => ContainsAnyExcept((ReadOnlySpan)span, value); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static bool ContainsAnyExcept(this Span span, T value0, T value1) where T : IEquatable? => ContainsAnyExcept((ReadOnlySpan)span, value0, value1); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static bool ContainsAnyExcept(this Span span, T value0, T value1, T value2) where T : IEquatable? => ContainsAnyExcept((ReadOnlySpan)span, value0, value1, value2); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static bool ContainsAnyExcept(this Span span, ReadOnlySpan values) where T : IEquatable? => ContainsAnyExcept((ReadOnlySpan)span, values); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static bool ContainsAnyExcept(this Span span, SearchValues values) where T : IEquatable? => ContainsAnyExcept((ReadOnlySpan)span, values); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static bool ContainsAnyInRange(this Span span, T lowInclusive, T highInclusive) where T : IComparable => ContainsAnyInRange((ReadOnlySpan)span, lowInclusive, highInclusive); /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static bool ContainsAnyExceptInRange(this Span span, T lowInclusive, T highInclusive) where T : IComparable => ContainsAnyExceptInRange((ReadOnlySpan)span, lowInclusive, highInclusive); @@ -580,6 +593,7 @@ public static bool ContainsAnyExceptInRange(this ReadOnlySpan span, T lowI /// The span to search. /// The value to search for. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static unsafe int IndexOf(this Span span, T value) where T : IEquatable? => IndexOf((ReadOnlySpan)span, value); @@ -589,6 +603,7 @@ public static unsafe int IndexOf(this Span span, T value) where T : IEquat /// The span to search. /// The sequence to search for. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static unsafe int IndexOf(this Span span, ReadOnlySpan value) where T : IEquatable? => IndexOf((ReadOnlySpan)span, value); @@ -598,6 +613,7 @@ public static unsafe int IndexOf(this Span span, ReadOnlySpan value) wh /// The span to search. /// The value to search for. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static unsafe int LastIndexOf(this Span span, T value) where T : IEquatable? => LastIndexOf((ReadOnlySpan)span, value); @@ -607,6 +623,7 @@ public static unsafe int LastIndexOf(this Span span, T value) where T : IE /// The span to search. /// The sequence to search for. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static unsafe int LastIndexOf(this Span span, ReadOnlySpan value) where T : IEquatable? => LastIndexOf((ReadOnlySpan)span, value); @@ -618,6 +635,7 @@ public static unsafe int LastIndexOf(this Span span, ReadOnlySpan value /// The index in the span of the first occurrence of any value other than . /// If all of the values are , returns -1. /// + [OverloadResolutionPriority(-1)] public static int IndexOfAnyExcept(this Span span, T value) where T : IEquatable? => IndexOfAnyExcept((ReadOnlySpan)span, value); @@ -630,6 +648,7 @@ public static int IndexOfAnyExcept(this Span span, T value) where T : IEqu /// The index in the span of the first occurrence of any value other than and . /// If all of the values are or , returns -1. /// + [OverloadResolutionPriority(-1)] public static int IndexOfAnyExcept(this Span span, T value0, T value1) where T : IEquatable? => IndexOfAnyExcept((ReadOnlySpan)span, value0, value1); @@ -643,6 +662,7 @@ public static int IndexOfAnyExcept(this Span span, T value0, T value1) whe /// The index in the span of the first occurrence of any value other than , , and . /// If all of the values are , , or , returns -1. /// + [OverloadResolutionPriority(-1)] public static int IndexOfAnyExcept(this Span span, T value0, T value1, T value2) where T : IEquatable? => IndexOfAnyExcept((ReadOnlySpan)span, value0, value1, value2); @@ -654,6 +674,7 @@ public static int IndexOfAnyExcept(this Span span, T value0, T value1, T v /// The index in the span of the first occurrence of any value other than those in . /// If all of the values are in , returns -1. /// + [OverloadResolutionPriority(-1)] public static int IndexOfAnyExcept(this Span span, ReadOnlySpan values) where T : IEquatable? => IndexOfAnyExcept((ReadOnlySpan)span, values); @@ -666,6 +687,7 @@ public static int IndexOfAnyExcept(this Span span, ReadOnlySpan values) /// If all of the values are in , returns -1. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static int IndexOfAnyExcept(this Span span, SearchValues values) where T : IEquatable? => IndexOfAnyExcept((ReadOnlySpan)span, values); @@ -927,6 +949,7 @@ public static int IndexOfAnyExcept(this ReadOnlySpan span, SearchValues /// The index in the span of the last occurrence of any value other than . /// If all of the values are , returns -1. /// + [OverloadResolutionPriority(-1)] public static int LastIndexOfAnyExcept(this Span span, T value) where T : IEquatable? => LastIndexOfAnyExcept((ReadOnlySpan)span, value); @@ -939,6 +962,7 @@ public static int LastIndexOfAnyExcept(this Span span, T value) where T : /// The index in the span of the last occurrence of any value other than and . /// If all of the values are or , returns -1. /// + [OverloadResolutionPriority(-1)] public static int LastIndexOfAnyExcept(this Span span, T value0, T value1) where T : IEquatable? => LastIndexOfAnyExcept((ReadOnlySpan)span, value0, value1); @@ -952,6 +976,7 @@ public static int LastIndexOfAnyExcept(this Span span, T value0, T value1) /// The index in the span of the last occurrence of any value other than , , and . /// If all of the values are , , and , returns -1. /// + [OverloadResolutionPriority(-1)] public static int LastIndexOfAnyExcept(this Span span, T value0, T value1, T value2) where T : IEquatable? => LastIndexOfAnyExcept((ReadOnlySpan)span, value0, value1, value2); @@ -963,6 +988,7 @@ public static int LastIndexOfAnyExcept(this Span span, T value0, T value1, /// The index in the span of the last occurrence of any value other than those in . /// If all of the values are in , returns -1. /// + [OverloadResolutionPriority(-1)] public static int LastIndexOfAnyExcept(this Span span, ReadOnlySpan values) where T : IEquatable? => LastIndexOfAnyExcept((ReadOnlySpan)span, values); @@ -975,6 +1001,7 @@ public static int LastIndexOfAnyExcept(this Span span, ReadOnlySpan val /// If all of the values are in , returns -1. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static int LastIndexOfAnyExcept(this Span span, SearchValues values) where T : IEquatable? => LastIndexOfAnyExcept((ReadOnlySpan)span, values); @@ -1231,6 +1258,7 @@ public static int LastIndexOfAnyExcept(this ReadOnlySpan span, SearchValue /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static int IndexOfAnyInRange(this Span span, T lowInclusive, T highInclusive) where T : IComparable => IndexOfAnyInRange((ReadOnlySpan)span, lowInclusive, highInclusive); @@ -1295,6 +1323,7 @@ ref Unsafe.As(ref MemoryMarshal.GetReference(span)), /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static int IndexOfAnyExceptInRange(this Span span, T lowInclusive, T highInclusive) where T : IComparable => IndexOfAnyExceptInRange((ReadOnlySpan)span, lowInclusive, highInclusive); @@ -1359,6 +1388,7 @@ ref Unsafe.As(ref MemoryMarshal.GetReference(span)), /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static int LastIndexOfAnyInRange(this Span span, T lowInclusive, T highInclusive) where T : IComparable => LastIndexOfAnyInRange((ReadOnlySpan)span, lowInclusive, highInclusive); @@ -1423,6 +1453,7 @@ ref Unsafe.As(ref MemoryMarshal.GetReference(span)), /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static int LastIndexOfAnyExceptInRange(this Span span, T lowInclusive, T highInclusive) where T : IComparable => LastIndexOfAnyExceptInRange((ReadOnlySpan)span, lowInclusive, highInclusive); @@ -1498,12 +1529,14 @@ private static void ThrowNullLowHighInclusive(T? lowInclusive, T? highInclusi /// [Intrinsic] // Unrolled and vectorized for half-constant input [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static unsafe bool SequenceEqual(this Span span, ReadOnlySpan other) where T : IEquatable? => SequenceEqual((ReadOnlySpan)span, other); /// /// Determines the relative order of the sequences being compared by comparing the elements using IComparable{T}.CompareTo(T). /// + [OverloadResolutionPriority(-1)] public static int SequenceCompareTo(this Span span, ReadOnlySpan other) where T : IComparable? => SequenceCompareTo((ReadOnlySpan)span, other); @@ -1654,6 +1687,7 @@ ref Unsafe.As(ref MemoryMarshal.GetReference(value)), /// One of the values to search for. /// One of the values to search for. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static unsafe int IndexOfAny(this Span span, T value0, T value1) where T : IEquatable? => IndexOfAny((ReadOnlySpan)span, value0, value1); @@ -1665,6 +1699,7 @@ public static unsafe int IndexOfAny(this Span span, T value0, T value1) wh /// One of the values to search for. /// One of the values to search for. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static unsafe int IndexOfAny(this Span span, T value0, T value1, T value2) where T : IEquatable? => IndexOfAny((ReadOnlySpan)span, value0, value1, value2); @@ -1674,6 +1709,7 @@ public static unsafe int IndexOfAny(this Span span, T value0, T value1, T /// The span to search. /// The set of values to search for. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static int IndexOfAny(this Span span, ReadOnlySpan values) where T : IEquatable? => IndexOfAny((ReadOnlySpan)span, values); @@ -1683,6 +1719,7 @@ public static int IndexOfAny(this Span span, ReadOnlySpan values) where /// The span to search. /// The set of values to search for. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static int IndexOfAny(this Span span, SearchValues values) where T : IEquatable? => IndexOfAny((ReadOnlySpan)span, values); @@ -1692,6 +1729,7 @@ public static int IndexOfAny(this Span span, SearchValues values) where /// The span to search. /// The set of values to search for. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static int IndexOfAny(this Span span, SearchValues values) => IndexOfAny((ReadOnlySpan)span, values); @@ -1903,6 +1941,7 @@ public static int IndexOfAny(this ReadOnlySpan span, SearchValues /// One of the values to search for. /// One of the values to search for. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static unsafe int LastIndexOfAny(this Span span, T value0, T value1) where T : IEquatable? => LastIndexOfAny((ReadOnlySpan)span, value0, value1); @@ -1914,6 +1953,7 @@ public static unsafe int LastIndexOfAny(this Span span, T value0, T value1 /// One of the values to search for. /// One of the values to search for. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static unsafe int LastIndexOfAny(this Span span, T value0, T value1, T value2) where T : IEquatable? => LastIndexOfAny((ReadOnlySpan)span, value0, value1, value2); @@ -1923,6 +1963,7 @@ public static unsafe int LastIndexOfAny(this Span span, T value0, T value1 /// The span to search. /// The set of values to search for. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static int LastIndexOfAny(this Span span, ReadOnlySpan values) where T : IEquatable? => LastIndexOfAny((ReadOnlySpan)span, values); @@ -1932,6 +1973,7 @@ public static int LastIndexOfAny(this Span span, ReadOnlySpan values) w /// The span to search. /// The set of values to search for. [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static int LastIndexOfAny(this Span span, SearchValues values) where T : IEquatable? => LastIndexOfAny((ReadOnlySpan)span, values); @@ -2147,6 +2189,7 @@ ref Unsafe.As(ref MemoryMarshal.GetReference(other)), /// The second sequence to compare. /// The implementation to use when comparing elements, or null to use the default for the type of an element. /// true if the two sequences are equal; otherwise, false. + [OverloadResolutionPriority(-1)] public static bool SequenceEqual(this Span span, ReadOnlySpan other, IEqualityComparer? comparer = null) => SequenceEqual((ReadOnlySpan)span, other, comparer); @@ -2235,6 +2278,7 @@ ref Unsafe.As(ref MemoryMarshal.GetReference(other)), /// [Intrinsic] // Unrolled and vectorized for half-constant input [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static unsafe bool StartsWith(this Span span, ReadOnlySpan value) where T : IEquatable? => StartsWith((ReadOnlySpan)span, value); @@ -2263,6 +2307,7 @@ ref Unsafe.As(ref MemoryMarshal.GetReference(value)), /// [MethodImpl(MethodImplOptions.AggressiveInlining)] [Intrinsic] // Unrolled and vectorized for half-constant input + [OverloadResolutionPriority(-1)] public static unsafe bool EndsWith(this Span span, ReadOnlySpan value) where T : IEquatable? => EndsWith((ReadOnlySpan)span, value); @@ -2708,6 +2753,7 @@ public static void CopyTo(this T[]? source, Memory destination) /// Determines whether two sequences overlap in memory. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static bool Overlaps(this Span span, ReadOnlySpan other) => Overlaps((ReadOnlySpan)span, other); @@ -2715,6 +2761,7 @@ public static bool Overlaps(this Span span, ReadOnlySpan other) => /// Determines whether two sequences overlap in memory and outputs the element offset. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static bool Overlaps(this Span span, ReadOnlySpan other, out int elementOffset) => Overlaps((ReadOnlySpan)span, other, out elementOffset); @@ -2784,6 +2831,7 @@ ref MemoryMarshal.GetReference(span), /// is . /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static int BinarySearch(this Span span, IComparable comparable) => BinarySearch((ReadOnlySpan)span, comparable); @@ -2805,6 +2853,7 @@ public static int BinarySearch(this Span span, IComparable comparable) /// is . /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static int BinarySearch( this Span span, TComparable comparable) where TComparable : IComparable, allows ref struct => @@ -2829,6 +2878,7 @@ public static int BinarySearch( /// is . /// [MethodImpl(MethodImplOptions.AggressiveInlining)] + [OverloadResolutionPriority(-1)] public static int BinarySearch( this Span span, T value, TComparer comparer) where TComparer : IComparer, allows ref struct => @@ -3194,6 +3244,7 @@ ref Unsafe.As(ref dst), /// The first sequence to compare. /// The second sequence to compare. /// The length of the common prefix shared by the two spans. If there's no shared prefix, 0 is returned. + [OverloadResolutionPriority(-1)] public static int CommonPrefixLength(this Span span, ReadOnlySpan other) => CommonPrefixLength((ReadOnlySpan)span, other); @@ -3203,6 +3254,7 @@ public static int CommonPrefixLength(this Span span, ReadOnlySpan other /// The second sequence to compare. /// The implementation to use when comparing elements, or null to use the default for the type of an element. /// The length of the common prefix shared by the two spans. If there's no shared prefix, 0 is returned. + [OverloadResolutionPriority(-1)] public static int CommonPrefixLength(this Span span, ReadOnlySpan other, IEqualityComparer? comparer) => CommonPrefixLength((ReadOnlySpan)span, other, comparer); @@ -3695,6 +3747,7 @@ private static (int StartInclusive, int EndExclusive) TrimSplitEntry(ReadOnlySpa /// The span to search. /// The value for which to search. /// The number of times was found in the . + [OverloadResolutionPriority(-1)] public static int Count(this Span span, T value) where T : IEquatable? => Count((ReadOnlySpan)span, value); @@ -3749,6 +3802,7 @@ ref MemoryMarshal.GetReference(span), /// The span to search. /// The value for which to search. /// The number of times was found in the . + [OverloadResolutionPriority(-1)] public static int Count(this Span span, ReadOnlySpan value) where T : IEquatable? => Count((ReadOnlySpan)span, value); diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs index b2274943e51821..30a3cb9fa37287 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs @@ -119,6 +119,7 @@ public Vector(ReadOnlySpan values) /// The span from which the vector is created. /// A new with its elements set to the first elements from . /// The length of is less than . + [OverloadResolutionPriority(-1)] public Vector(Span values) : this((ReadOnlySpan)values) { } diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/OverloadResolutionPriorityAttribute.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/OverloadResolutionPriorityAttribute.cs index f38d3195815b1d..33a8383d734727 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/OverloadResolutionPriorityAttribute.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/CompilerServices/OverloadResolutionPriorityAttribute.cs @@ -7,7 +7,12 @@ namespace System.Runtime.CompilerServices /// Specifies the priority of a member in overload resolution. When unspecified, the default priority is 0. /// [AttributeUsage(AttributeTargets.Method | AttributeTargets.Constructor | AttributeTargets.Property, AllowMultiple = false, Inherited = false)] - public sealed class OverloadResolutionPriorityAttribute : Attribute +#if SYSTEM_PRIVATE_CORELIB + public +#else + internal +#endif + sealed class OverloadResolutionPriorityAttribute : Attribute { /// /// Initializes a new instance of the class. diff --git a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.BinarySearch.cs b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.BinarySearch.cs index 9815a4b5e66cb0..72fc2ddaec7645 100644 --- a/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.BinarySearch.cs +++ b/src/libraries/System.Private.CoreLib/src/System/SpanHelpers.BinarySearch.cs @@ -11,7 +11,7 @@ internal static partial class SpanHelpers { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int BinarySearch( - this ReadOnlySpan span, TComparable comparable) + ReadOnlySpan span, TComparable comparable) where TComparable : IComparable, allows ref struct { if (comparable == null)