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

Reapply keyword params #101499

Merged
merged 2 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ public static partial class ImmutableArray
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(T item1, T item2, T item3, T item4) { throw null; }
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(params T[]? items) { throw null; }
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(T[] items, int start, int length) { throw null; }
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(System.ReadOnlySpan<T> items) { throw null; }
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(params System.ReadOnlySpan<T> items) { throw null; }
public static System.Collections.Immutable.ImmutableArray<T> Create<T>(System.Span<T> items) { throw null; }
public static System.Collections.Immutable.ImmutableArray<TSource> ToImmutableArray<TSource>(this System.Collections.Generic.IEnumerable<TSource> items) { throw null; }
public static System.Collections.Immutable.ImmutableArray<TSource> ToImmutableArray<TSource>(this System.Collections.Immutable.ImmutableArray<TSource>.Builder builder) { throw null; }
Expand Down Expand Up @@ -244,7 +244,7 @@ public static partial class ImmutableArray
public System.Collections.Immutable.ImmutableArray<T> AddRange<TDerived>(TDerived[] items) where TDerived : T { throw null; }
public System.Collections.Immutable.ImmutableArray<T> AddRange(ImmutableArray<T> items, int length) { throw null; }
public System.Collections.Immutable.ImmutableArray<T> AddRange<TDerived>(ImmutableArray<TDerived> items) where TDerived : T { throw null; }
public System.Collections.Immutable.ImmutableArray<T> AddRange(System.ReadOnlySpan<T> items) { throw null; }
public System.Collections.Immutable.ImmutableArray<T> AddRange(params System.ReadOnlySpan<T> items) { throw null; }
public System.Collections.Immutable.ImmutableArray<T> AddRange(params T[] items) { throw null; }
public System.ReadOnlyMemory<T> AsMemory() { throw null; }
public System.ReadOnlySpan<T> AsSpan() { throw null; }
Expand Down Expand Up @@ -284,7 +284,7 @@ public void CopyTo(System.Span<T> destination) { }
public System.Collections.Immutable.ImmutableArray<T> InsertRange(int index, System.Collections.Generic.IEnumerable<T> items) { throw null; }
public System.Collections.Immutable.ImmutableArray<T> InsertRange(int index, System.Collections.Immutable.ImmutableArray<T> items) { throw null; }
public System.Collections.Immutable.ImmutableArray<T> InsertRange(int index, T[] items) { throw null; }
public System.Collections.Immutable.ImmutableArray<T> InsertRange(int index, System.ReadOnlySpan<T> items) { throw null; }
public System.Collections.Immutable.ImmutableArray<T> InsertRange(int index, params System.ReadOnlySpan<T> items) { throw null; }
public ref readonly T ItemRef(int index) { throw null; }
public int LastIndexOf(T item) { throw null; }
public int LastIndexOf(T item, int startIndex) { throw null; }
Expand Down Expand Up @@ -362,8 +362,8 @@ public void AddRange(T[] items, int length) { }
public void AddRange<TDerived>(System.Collections.Immutable.ImmutableArray<TDerived> items) where TDerived : T { }
public void AddRange<TDerived>(System.Collections.Immutable.ImmutableArray<TDerived>.Builder items) where TDerived : T { }
public void AddRange<TDerived>(TDerived[] items) where TDerived : T { }
public void AddRange(System.ReadOnlySpan<T> items) { }
public void AddRange<TDerived>(System.ReadOnlySpan<TDerived> items) where TDerived : T { }
public void AddRange(params System.ReadOnlySpan<T> items) { }
public void AddRange<TDerived>(params System.ReadOnlySpan<TDerived> items) where TDerived : T { }
public void Clear() { }
public bool Contains(T item) { throw null; }
public void CopyTo(T[] array, int index) { }
Expand Down Expand Up @@ -562,10 +562,10 @@ public static partial class ImmutableHashSet
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T>(System.Collections.Generic.IEqualityComparer<T>? equalityComparer) { throw null; }
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T>(System.Collections.Generic.IEqualityComparer<T>? equalityComparer, T item) { throw null; }
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T>(System.Collections.Generic.IEqualityComparer<T>? equalityComparer, params T[] items) { throw null; }
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T>(System.Collections.Generic.IEqualityComparer<T>? equalityComparer, System.ReadOnlySpan<T> items) { throw null; }
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T>(System.Collections.Generic.IEqualityComparer<T>? equalityComparer, params System.ReadOnlySpan<T> items) { throw null; }
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T>(T item) { throw null; }
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T>(params T[] items) { throw null; }
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T>(System.ReadOnlySpan<T> items) { throw null; }
public static System.Collections.Immutable.ImmutableHashSet<T> Create<T>(params System.ReadOnlySpan<T> items) { throw null; }
public static System.Collections.Immutable.ImmutableHashSet<TSource> ToImmutableHashSet<TSource>(this System.Collections.Generic.IEnumerable<TSource> source) { throw null; }
public static System.Collections.Immutable.ImmutableHashSet<TSource> ToImmutableHashSet<TSource>(this System.Collections.Generic.IEnumerable<TSource> source, System.Collections.Generic.IEqualityComparer<TSource>? equalityComparer) { throw null; }
public static System.Collections.Immutable.ImmutableHashSet<TSource> ToImmutableHashSet<TSource>(this System.Collections.Immutable.ImmutableHashSet<TSource>.Builder builder) { throw null; }
Expand Down Expand Up @@ -691,7 +691,7 @@ public static partial class ImmutableList
public static System.Collections.Immutable.ImmutableList<T> Create<T>() { throw null; }
public static System.Collections.Immutable.ImmutableList<T> Create<T>(T item) { throw null; }
public static System.Collections.Immutable.ImmutableList<T> Create<T>(params T[] items) { throw null; }
public static System.Collections.Immutable.ImmutableList<T> Create<T>(System.ReadOnlySpan<T> items) { throw null; }
public static System.Collections.Immutable.ImmutableList<T> Create<T>(params System.ReadOnlySpan<T> items) { throw null; }
public static int IndexOf<T>(this System.Collections.Immutable.IImmutableList<T> list, T item) { throw null; }
public static int IndexOf<T>(this System.Collections.Immutable.IImmutableList<T> list, T item, System.Collections.Generic.IEqualityComparer<T>? equalityComparer) { throw null; }
public static int IndexOf<T>(this System.Collections.Immutable.IImmutableList<T> list, T item, int startIndex) { throw null; }
Expand Down Expand Up @@ -887,7 +887,7 @@ public static partial class ImmutableQueue
public static System.Collections.Immutable.ImmutableQueue<T> Create<T>() { throw null; }
public static System.Collections.Immutable.ImmutableQueue<T> Create<T>(T item) { throw null; }
public static System.Collections.Immutable.ImmutableQueue<T> Create<T>(params T[] items) { throw null; }
public static System.Collections.Immutable.ImmutableQueue<T> Create<T>(System.ReadOnlySpan<T> items) { throw null; }
public static System.Collections.Immutable.ImmutableQueue<T> Create<T>(params System.ReadOnlySpan<T> items) { throw null; }
public static System.Collections.Immutable.IImmutableQueue<T> Dequeue<T>(this System.Collections.Immutable.IImmutableQueue<T> queue, out T value) { throw null; }
}
[System.Runtime.CompilerServices.CollectionBuilderAttribute(typeof(System.Collections.Immutable.ImmutableQueue), "Create")]
Expand Down Expand Up @@ -1063,10 +1063,10 @@ public static partial class ImmutableSortedSet
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(System.Collections.Generic.IComparer<T>? comparer) { throw null; }
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(System.Collections.Generic.IComparer<T>? comparer, T item) { throw null; }
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(System.Collections.Generic.IComparer<T>? comparer, params T[] items) { throw null; }
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(System.Collections.Generic.IComparer<T>? comparer, System.ReadOnlySpan<T> items) { throw null; }
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(System.Collections.Generic.IComparer<T>? comparer, params System.ReadOnlySpan<T> items) { throw null; }
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(T item) { throw null; }
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(params T[] items) { throw null; }
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(System.ReadOnlySpan<T> items) { throw null; }
public static System.Collections.Immutable.ImmutableSortedSet<T> Create<T>(params System.ReadOnlySpan<T> items) { throw null; }
public static System.Collections.Immutable.ImmutableSortedSet<TSource> ToImmutableSortedSet<TSource>(this System.Collections.Generic.IEnumerable<TSource> source) { throw null; }
public static System.Collections.Immutable.ImmutableSortedSet<TSource> ToImmutableSortedSet<TSource>(this System.Collections.Generic.IEnumerable<TSource> source, System.Collections.Generic.IComparer<TSource>? comparer) { throw null; }
public static System.Collections.Immutable.ImmutableSortedSet<TSource> ToImmutableSortedSet<TSource>(this System.Collections.Immutable.ImmutableSortedSet<TSource>.Builder builder) { throw null; }
Expand Down Expand Up @@ -1198,7 +1198,7 @@ public static partial class ImmutableStack
public static System.Collections.Immutable.ImmutableStack<T> Create<T>() { throw null; }
public static System.Collections.Immutable.ImmutableStack<T> Create<T>(T item) { throw null; }
public static System.Collections.Immutable.ImmutableStack<T> Create<T>(params T[] items) { throw null; }
public static System.Collections.Immutable.ImmutableStack<T> Create<T>(System.ReadOnlySpan<T> items) { throw null; }
public static System.Collections.Immutable.ImmutableStack<T> Create<T>(params System.ReadOnlySpan<T> items) { throw null; }
public static System.Collections.Immutable.IImmutableStack<T> Pop<T>(this System.Collections.Immutable.IImmutableStack<T> stack, out T value) { throw null; }
}
[System.Runtime.CompilerServices.CollectionBuilderAttribute(typeof(System.Collections.Immutable.ImmutableStack), "Create")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public static ImmutableArray<T> Create<T>(T item1, T item2, T item3, T item4)
/// <typeparam name="T">The type of element stored in the array.</typeparam>
/// <param name="items">The elements to store in the array.</param>
/// <returns>An immutable array containing the specified items.</returns>
public static ImmutableArray<T> Create<T>(/*params*/ ReadOnlySpan<T> items)
public static ImmutableArray<T> Create<T>(params ReadOnlySpan<T> items)
{
if (items.IsEmpty)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public void AddRange(ImmutableArray<T> items, int length)
/// Adds the specified items to the end of the array.
/// </summary>
/// <param name="items">The items to add at the end of the array.</param>
public void AddRange(/*params*/ ReadOnlySpan<T> items)
public void AddRange(params ReadOnlySpan<T> items)
{
int offset = this.Count;
this.Count += items.Length;
Expand All @@ -443,7 +443,7 @@ public void AddRange(/*params*/ ReadOnlySpan<T> items)
/// </summary>
/// <typeparam name="TDerived">The type that derives from the type of item already in the array.</typeparam>
/// <param name="items">The items to add at the end of the array.</param>
public void AddRange<TDerived>(/*params*/ ReadOnlySpan<TDerived> items) where TDerived : T
public void AddRange<TDerived>(params ReadOnlySpan<TDerived> items) where TDerived : T
{
int offset = this.Count;
this.Count += items.Length;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ public IEnumerable<TResult> OfType<TResult>()
/// </summary>
/// <param name="items">The values to add.</param>
/// <returns>A new list with the elements added.</returns>
public ImmutableArray<T> AddRange(/*params*/ ReadOnlySpan<T> items)
public ImmutableArray<T> AddRange(params ReadOnlySpan<T> items)
{
ImmutableArray<T> self = this;
return self.InsertRange(self.Length, items);
Expand Down Expand Up @@ -949,7 +949,7 @@ public ImmutableArray<T> InsertRange(int index, T[] items)
/// <param name="index">The index at which to insert the value.</param>
/// <param name="items">The elements to insert.</param>
/// <returns>The new immutable collection.</returns>
public ImmutableArray<T> InsertRange(int index, /*params*/ ReadOnlySpan<T> items)
public ImmutableArray<T> InsertRange(int index, params ReadOnlySpan<T> items)
{
ImmutableArray<T> self = this;
self.ThrowNullRefIfNotInitialized();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public static ImmutableHashSet<T> Create<T>(params T[] items)
/// <typeparam name="T">The type of items stored by the collection.</typeparam>
/// <param name="items">The items to prepopulate.</param>
/// <returns>The new immutable collection.</returns>
public static ImmutableHashSet<T> Create<T>(/*params*/ ReadOnlySpan<T> items)
public static ImmutableHashSet<T> Create<T>(params ReadOnlySpan<T> items)
{
return ImmutableHashSet<T>.Empty.Union(items);
}
Expand All @@ -124,7 +124,7 @@ public static ImmutableHashSet<T> Create<T>(IEqualityComparer<T>? equalityCompar
/// <param name="equalityComparer">The equality comparer.</param>
/// <param name="items">The items to prepopulate.</param>
/// <returns>The new immutable collection.</returns>
public static ImmutableHashSet<T> Create<T>(IEqualityComparer<T>? equalityComparer, /*params*/ ReadOnlySpan<T> items)
public static ImmutableHashSet<T> Create<T>(IEqualityComparer<T>? equalityComparer, params ReadOnlySpan<T> items)
{
return ImmutableHashSet<T>.Empty.WithComparer(equalityComparer).Union(items);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static ImmutableList<T> Create<T>(params T[] items)
/// <typeparam name="T">The type of items stored by the collection.</typeparam>
/// <param name="items">A span that contains the items to prepopulate the list with.</param>
/// <returns>A new immutable list that contains the specified items.</returns>
public static ImmutableList<T> Create<T>(/*params*/ ReadOnlySpan<T> items) => ImmutableList<T>.Empty.AddRange(items);
public static ImmutableList<T> Create<T>(params ReadOnlySpan<T> items) => ImmutableList<T>.Empty.AddRange(items);

/// <summary>
/// Creates a new immutable list builder.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static ImmutableQueue<T> Create<T>(params T[] items)
/// <typeparam name="T">The type of items in the immutable queue.</typeparam>
/// <param name="items">A span that contains the items to prepopulate the queue with.</param>
/// <returns>A new immutable queue that contains the specified items.</returns>
public static ImmutableQueue<T> Create<T>(/*params*/ ReadOnlySpan<T> items)
public static ImmutableQueue<T> Create<T>(params ReadOnlySpan<T> items)
{
if (items.IsEmpty)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static ImmutableSortedSet<T> Create<T>(params T[] items)
/// <typeparam name="T">The type of items in the immutable set.</typeparam>
/// <param name="items">A span that contains the items to prepopulate the set with.</param>
/// <returns>A new immutable set that contains the specified items.</returns>
public static ImmutableSortedSet<T> Create<T>(/*params*/ ReadOnlySpan<T> items)
public static ImmutableSortedSet<T> Create<T>(params ReadOnlySpan<T> items)
{
return ImmutableSortedSet<T>.Empty.Union(items);
}
Expand All @@ -123,7 +123,7 @@ public static ImmutableSortedSet<T> Create<T>(IComparer<T>? comparer, params T[]
/// <param name="comparer">The comparer.</param>
/// <param name="items">The items to prepopulate.</param>
/// <returns>The new immutable collection.</returns>
public static ImmutableSortedSet<T> Create<T>(IComparer<T>? comparer, /*params*/ ReadOnlySpan<T> items)
public static ImmutableSortedSet<T> Create<T>(IComparer<T>? comparer, params ReadOnlySpan<T> items)
{
return ImmutableSortedSet<T>.Empty.WithComparer(comparer).Union(items);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public static ImmutableStack<T> Create<T>(params T[] items)
/// <typeparam name="T">The type of items in the immutable stack.</typeparam>
/// <param name="items">A span that contains the items to prepopulate the stack with.</param>
/// <returns>A new immutable stack that contains the specified items.</returns>
public static ImmutableStack<T> Create<T>(/*params*/ ReadOnlySpan<T> items)
public static ImmutableStack<T> Create<T>(params ReadOnlySpan<T> items)
{
ImmutableStack<T> stack = ImmutableStack<T>.Empty;
foreach (T item in items)
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/System.Collections/ref/System.Collections.cs
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,11 @@ namespace System.Collections.Generic
{
public static partial class CollectionExtensions
{
public static void AddRange<T>(this System.Collections.Generic.List<T> list, System.ReadOnlySpan<T> source) { }
public static void AddRange<T>(this System.Collections.Generic.List<T> list, params System.ReadOnlySpan<T> source) { }
public static void CopyTo<T>(this System.Collections.Generic.List<T> list, System.Span<T> destination) { }
public static TValue? GetValueOrDefault<TKey, TValue>(this System.Collections.Generic.IReadOnlyDictionary<TKey, TValue> dictionary, TKey key) { throw null; }
public static TValue GetValueOrDefault<TKey, TValue>(this System.Collections.Generic.IReadOnlyDictionary<TKey, TValue> dictionary, TKey key, TValue defaultValue) { throw null; }
public static void InsertRange<T>(this System.Collections.Generic.List<T> list, int index, System.ReadOnlySpan<T> source) { }
public static void InsertRange<T>(this System.Collections.Generic.List<T> list, int index, params System.ReadOnlySpan<T> source) { }
public static bool Remove<TKey, TValue>(this System.Collections.Generic.IDictionary<TKey, TValue> dictionary, TKey key, [System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute(false)] out TValue value) { throw null; }
public static bool TryAdd<TKey, TValue>(this System.Collections.Generic.IDictionary<TKey, TValue> dictionary, TKey key, TValue value) { throw null; }
public static System.Collections.ObjectModel.ReadOnlyCollection<T> AsReadOnly<T>(this IList<T> list) { throw null; }
Expand Down
Loading
Loading