From 8db4bef22ce0ba465e980d9e381d84f99aae31db Mon Sep 17 00:00:00 2001 From: Pawel Flajszer <45766938+pflajszer@users.noreply.github.com> Date: Sat, 24 Jun 2023 11:17:40 +0200 Subject: [PATCH] Remove obsolete "Concat" method This is a squashed merge of PR #1002 that closes #993. --- MoreLinq/Append.cs | 13 --------- MoreLinq/CompatibilitySuppressions.xml | 28 +++++++++++++++++++ .../PublicAPI/net6.0/PublicAPI.Unshipped.txt | 1 + .../netstandard2.0/PublicAPI.Unshipped.txt | 1 + .../netstandard2.1/PublicAPI.Unshipped.txt | 1 + README.md | 7 +++-- 6 files changed, 36 insertions(+), 15 deletions(-) diff --git a/MoreLinq/Append.cs b/MoreLinq/Append.cs index e0800b364..b081bbd83 100644 --- a/MoreLinq/Append.cs +++ b/MoreLinq/Append.cs @@ -38,18 +38,5 @@ public static IEnumerable Append(this IEnumerable head, T tail) ? node.Concat(tail) : PendNode.WithSource(head).Concat(tail); } - - /// - /// Returns a sequence consisting of the head elements and the given tail element. - /// - /// Type of sequence - /// All elements of the head. Must not be null. - /// Tail element of the new sequence. - /// A sequence consisting of the head elements and the given tail element. - /// This operator uses deferred execution and streams its results. - - [Obsolete("Use " + nameof(Append) + " instead.")] - public static IEnumerable Concat(this IEnumerable head, T tail) => - head.Append(tail); } } diff --git a/MoreLinq/CompatibilitySuppressions.xml b/MoreLinq/CompatibilitySuppressions.xml index 1d7bf3d3e..da1602414 100644 --- a/MoreLinq/CompatibilitySuppressions.xml +++ b/MoreLinq/CompatibilitySuppressions.xml @@ -1,6 +1,34 @@ + + CP0002 + M:MoreLinq.MoreEnumerable.Concat``1(System.Collections.Generic.IEnumerable{``0},``0) + lib/net462/MoreLinq.dll + lib/netstandard2.0/MoreLinq.dll + true + + + CP0002 + M:MoreLinq.MoreEnumerable.Concat``1(System.Collections.Generic.IEnumerable{``0},``0) + lib/net6.0/MoreLinq.dll + lib/net6.0/MoreLinq.dll + true + + + CP0002 + M:MoreLinq.MoreEnumerable.Concat``1(System.Collections.Generic.IEnumerable{``0},``0) + lib/netstandard2.0/MoreLinq.dll + lib/netstandard2.0/MoreLinq.dll + true + + + CP0002 + M:MoreLinq.MoreEnumerable.Concat``1(System.Collections.Generic.IEnumerable{``0},``0) + lib/netstandard2.1/MoreLinq.dll + lib/netstandard2.1/MoreLinq.dll + true + PKV006 .NETStandard,Version=v1.0 diff --git a/MoreLinq/PublicAPI/net6.0/PublicAPI.Unshipped.txt b/MoreLinq/PublicAPI/net6.0/PublicAPI.Unshipped.txt index 7dc5c5811..b4ddb014c 100644 --- a/MoreLinq/PublicAPI/net6.0/PublicAPI.Unshipped.txt +++ b/MoreLinq/PublicAPI/net6.0/PublicAPI.Unshipped.txt @@ -1 +1,2 @@ #nullable enable +*REMOVED*static MoreLinq.MoreEnumerable.Concat(this System.Collections.Generic.IEnumerable! head, T tail) -> System.Collections.Generic.IEnumerable! diff --git a/MoreLinq/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt b/MoreLinq/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt index 7dc5c5811..b4ddb014c 100644 --- a/MoreLinq/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt +++ b/MoreLinq/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt @@ -1 +1,2 @@ #nullable enable +*REMOVED*static MoreLinq.MoreEnumerable.Concat(this System.Collections.Generic.IEnumerable! head, T tail) -> System.Collections.Generic.IEnumerable! diff --git a/MoreLinq/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt b/MoreLinq/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt index 7dc5c5811..b4ddb014c 100644 --- a/MoreLinq/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt +++ b/MoreLinq/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt @@ -1 +1,2 @@ #nullable enable +*REMOVED*static MoreLinq.MoreEnumerable.Concat(this System.Collections.Generic.IEnumerable! head, T tail) -> System.Collections.Generic.IEnumerable! diff --git a/README.md b/README.md index ece3287fc..2c9962eda 100644 --- a/README.md +++ b/README.md @@ -167,8 +167,11 @@ first sequence has fewer, the same or more elements than the second sequence. Returns a sequence consisting of the head element and the given tail elements. -This method is obsolete and will be removed in a future version. Use `Append` -instead. +This extension was rendered obsolete in version 3.0 and eventually removed in +version 4.0. Use [`Append`][linq-append] from .NET instead that's been available +since .NET Standard 1.6+, .NET Core 1.0+ and .NET Framework 4.7.1+. + +[linq-append]: https://learn.microsoft.com/en-us/dotnet/api/system.linq.enumerable.append ### Consume