From 353b80d19646eaa6c55d804f1645cc933f7eacb3 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 18:04:55 +0000 Subject: [PATCH 1/4] Initial plan From c78c146520fc4513ae560faaedc701aa0dd54d3b Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 18:09:33 +0000 Subject: [PATCH 2/4] Replace PolyfillExtensions with unique MemberPolyfills_* classes Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> --- PolyShim/List-Signatures.ps1 | 4 ++-- PolyShim/Net100/Random.cs | 4 +++- PolyShim/Net100/TimeSpan.cs | 4 +++- PolyShim/Net50/Convert.cs | 4 +++- .../DynamicallyAccessedMembersAttribute.cs | 2 ++ PolyShim/Net50/Enum.cs | 4 +++- PolyShim/Net50/Environment.cs | 4 +++- PolyShim/Net50/HttpClient.cs | 4 +++- PolyShim/Net50/HttpContent.cs | 4 +++- PolyShim/Net50/IntPtr.cs | 4 +++- PolyShim/Net50/MemberNotNullAttribute.cs | 2 ++ PolyShim/Net50/MemberNotNullWhenAttribute.cs | 2 ++ PolyShim/Net50/OperatingSystem.cs | 4 +++- PolyShim/Net50/Process.cs | 4 +++- .../RequiresUnreferencedCodeAttribute.cs | 2 ++ PolyShim/Net50/TaskCompletionSourceOfT.cs | 4 +++- PolyShim/Net50/Type.cs | 4 +++- PolyShim/Net50/UIntPtr.cs | 4 +++- .../UnconditionalSuppressMessageAttribute.cs | 2 ++ PolyShim/Net60/ArgumentNullException.cs | 4 +++- PolyShim/Net60/EnumerableExtensions.cs | 4 +++- PolyShim/Net60/Environment.cs | 4 +++- PolyShim/Net60/List.cs | 4 +++- PolyShim/Net60/Math.cs | 4 +++- PolyShim/Net60/Parallel.cs | 4 +++- PolyShim/Net60/Random.cs | 4 +++- .../Net60/RequiresAssemblyFilesAttribute.cs | 2 ++ PolyShim/Net60/String.cs | 4 +++- PolyShim/Net60/Task.cs | 4 +++- PolyShim/Net70/ArgumentException.cs | 4 +++- PolyShim/Net70/Byte.cs | 4 +++- PolyShim/Net70/DateTime.cs | 4 +++- PolyShim/Net70/DateTimeOffset.cs | 4 +++- PolyShim/Net70/Decimal.cs | 4 +++- PolyShim/Net70/Double.cs | 4 +++- PolyShim/Net70/EnumerableExtensions.cs | 4 +++- PolyShim/Net70/File.cs | 4 +++- PolyShim/Net70/Int16.cs | 4 +++- PolyShim/Net70/Int32.cs | 4 +++- PolyShim/Net70/Int64.cs | 4 +++- PolyShim/Net70/IntPtr.cs | 4 +++- PolyShim/Net70/Regex.cs | 4 +++- .../Net70/RequiresDynamicCodeAttribute.cs | 2 ++ PolyShim/Net70/SByte.cs | 4 +++- .../Net70/SetsRequiredMembersAttribute.cs | 2 ++ PolyShim/Net70/Single.cs | 4 +++- PolyShim/Net70/Stream.cs | 4 +++- PolyShim/Net70/StringSyntaxAttribute.cs | 2 ++ PolyShim/Net70/TextReader.cs | 4 +++- PolyShim/Net70/UInt16.cs | 4 +++- PolyShim/Net70/UInt32.cs | 4 +++- PolyShim/Net70/UInt64.cs | 4 +++- PolyShim/Net70/UIntPtr.cs | 4 +++- PolyShim/Net80/CancellationTokenSource.cs | 4 +++- PolyShim/Net80/EqualityComparer.cs | 3 ++- PolyShim/Net80/Parallel.cs | 4 +++- PolyShim/Net80/Random.cs | 4 +++- PolyShim/Net90/Convert.cs | 4 +++- PolyShim/Net90/EnumerableExtensions.cs | 4 +++- PolyShim/Net90/FeatureGuardAttribute.cs | 2 ++ .../Net90/FeatureSwitchDefinitionAttribute.cs | 2 ++ PolyShim/Net90/File.cs | 4 +++- PolyShim/Net90/Task.cs | 4 +++- PolyShim/Net90/TimeSpan.cs | 4 +++- PolyShim/NetCore10/AppContext.cs | 3 ++- PolyShim/NetCore10/Enum.cs | 4 +++- PolyShim/NetCore10/EnumerableExtensions.cs | 4 +++- PolyShim/NetCore10/Path.cs | 4 +++- PolyShim/NetCore10/Stream.cs | 4 +++- PolyShim/NetCore10/String.cs | 4 +++- PolyShim/NetCore10/Task.cs | 4 +++- PolyShim/NetCore10/TaskCompletionSource.cs | 4 +++- PolyShim/NetCore10/Version.cs | 4 +++- PolyShim/NetCore20/CollectionExtensions.cs | 5 ++++- PolyShim/NetCore20/Dictionary.cs | 4 +++- PolyShim/NetCore20/DictionaryEntry.cs | 4 +++- PolyShim/NetCore20/Enum.cs | 4 +++- PolyShim/NetCore20/EnumerableExtensions.cs | 4 +++- .../ExcludeFromCodeCoverageAttribute.cs | 2 ++ PolyShim/NetCore20/File.cs | 4 +++- PolyShim/NetCore20/HashSet.cs | 4 +++- PolyShim/NetCore20/KeyValuePair.cs | 4 +++- PolyShim/NetCore20/MatchCollection.cs | 4 +++- PolyShim/NetCore20/Math.cs | 4 +++- PolyShim/NetCore20/Path.cs | 4 +++- PolyShim/NetCore20/Queue.cs | 4 +++- PolyShim/NetCore20/SortedSet.cs | 4 +++- PolyShim/NetCore20/String.cs | 4 +++- PolyShim/NetCore20/Task.cs | 4 +++- PolyShim/NetCore20/Type.cs | 4 +++- PolyShim/NetCore21/DateTime.cs | 4 +++- PolyShim/NetCore21/DateTimeOffset.cs | 4 +++- .../NetCore21/MemoryExtensions.Contains.cs | 2 +- PolyShim/NetCore21/MemoryExtensions.cs | 5 ++++- PolyShim/NetCore21/Path.cs | 4 +++- PolyShim/NetCore21/Random.cs | 4 +++- PolyShim/NetCore21/Stream.cs | 4 +++- PolyShim/NetCore21/String.cs | 4 +++- PolyShim/NetCore21/TextReader.cs | 4 +++- PolyShim/NetCore21/TextWriter.cs | 4 +++- PolyShim/NetCore30/AllowNullAttribute.cs | 2 ++ PolyShim/NetCore30/DisallowNullAttribute.cs | 2 ++ PolyShim/NetCore30/DoesNotReturnAttribute.cs | 2 ++ .../NetCore30/DoesNotReturnIfAttribute.cs | 2 ++ PolyShim/NetCore30/EnumerableExtensions.cs | 4 +++- PolyShim/NetCore30/File.cs | 4 +++- PolyShim/NetCore30/MaybeNullAttribute.cs | 2 ++ PolyShim/NetCore30/MaybeNullWhenAttribute.cs | 2 ++ PolyShim/NetCore30/NotNullAttribute.cs | 2 ++ .../NetCore30/NotNullIfNotNullAttribute.cs | 2 ++ PolyShim/NetCore30/NotNullWhenAttribute.cs | 2 ++ PolyShim/NetCore30/OSPlatform.cs | 4 +++- PolyShim/NetCore30/Path.cs | 4 +++- PolyShim/NetCore30/Process.cs | 4 +++- PolyShim/NetCore30/Stream.cs | 4 +++- PolyShim/NetCore30/TextWriter.cs | 4 +++- PolyShim/PolyfillExtensions.cs | 19 ------------------- 117 files changed, 324 insertions(+), 115 deletions(-) delete mode 100644 PolyShim/PolyfillExtensions.cs diff --git a/PolyShim/List-Signatures.ps1 b/PolyShim/List-Signatures.ps1 index 1faf46e8..d3edd323 100644 --- a/PolyShim/List-Signatures.ps1 +++ b/PolyShim/List-Signatures.ps1 @@ -378,8 +378,8 @@ foreach ($file in $codeFiles) { $typeKind = $match.Groups[1].Value $typeName = $match.Groups[2].Value - # Skip PolyfillExtensions classes - if ($typeName -match '^PolyfillExtensions\d*$') { + # Skip MemberPolyfills_* classes + if ($typeName -match '^MemberPolyfills_') { continue } diff --git a/PolyShim/Net100/Random.cs b/PolyShim/Net100/Random.cs index 4c08d597..bca79dd8 100644 --- a/PolyShim/Net100/Random.cs +++ b/PolyShim/Net100/Random.cs @@ -7,8 +7,10 @@ using System; using System.Text; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net100_Random { extension(Random random) { diff --git a/PolyShim/Net100/TimeSpan.cs b/PolyShim/Net100/TimeSpan.cs index 47d755f8..b8283e8d 100644 --- a/PolyShim/Net100/TimeSpan.cs +++ b/PolyShim/Net100/TimeSpan.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net100_TimeSpan { extension(TimeSpan) { diff --git a/PolyShim/Net50/Convert.cs b/PolyShim/Net50/Convert.cs index b8066485..721753f4 100644 --- a/PolyShim/Net50/Convert.cs +++ b/PolyShim/Net50/Convert.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_Convert { extension(Convert) { diff --git a/PolyShim/Net50/DynamicallyAccessedMembersAttribute.cs b/PolyShim/Net50/DynamicallyAccessedMembersAttribute.cs index 4e112e8b..d8d514a2 100644 --- a/PolyShim/Net50/DynamicallyAccessedMembersAttribute.cs +++ b/PolyShim/Net50/DynamicallyAccessedMembersAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net50/Enum.cs b/PolyShim/Net50/Enum.cs index 3855c691..4ebb1241 100644 --- a/PolyShim/Net50/Enum.cs +++ b/PolyShim/Net50/Enum.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_Enum { extension(Enum) { diff --git a/PolyShim/Net50/Environment.cs b/PolyShim/Net50/Environment.cs index 4620fdf8..83dc1e32 100644 --- a/PolyShim/Net50/Environment.cs +++ b/PolyShim/Net50/Environment.cs @@ -7,8 +7,10 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_Environment { extension(Environment) { diff --git a/PolyShim/Net50/HttpClient.cs b/PolyShim/Net50/HttpClient.cs index 911ac2c9..3e0e30ea 100644 --- a/PolyShim/Net50/HttpClient.cs +++ b/PolyShim/Net50/HttpClient.cs @@ -11,8 +11,10 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_HttpClient { #if FEATURE_TASK extension(HttpClient httpClient) diff --git a/PolyShim/Net50/HttpContent.cs b/PolyShim/Net50/HttpContent.cs index 16fd5d4c..8484fc85 100644 --- a/PolyShim/Net50/HttpContent.cs +++ b/PolyShim/Net50/HttpContent.cs @@ -10,8 +10,10 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_HttpContent { #if FEATURE_TASK extension(HttpContent httpContent) diff --git a/PolyShim/Net50/IntPtr.cs b/PolyShim/Net50/IntPtr.cs index 5f291503..0dcb0f87 100644 --- a/PolyShim/Net50/IntPtr.cs +++ b/PolyShim/Net50/IntPtr.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions2 +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_IntPtr { extension(IntPtr) { diff --git a/PolyShim/Net50/MemberNotNullAttribute.cs b/PolyShim/Net50/MemberNotNullAttribute.cs index 54322fa8..61140ec9 100644 --- a/PolyShim/Net50/MemberNotNullAttribute.cs +++ b/PolyShim/Net50/MemberNotNullAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net50/MemberNotNullWhenAttribute.cs b/PolyShim/Net50/MemberNotNullWhenAttribute.cs index cc5d1601..05649aa9 100644 --- a/PolyShim/Net50/MemberNotNullWhenAttribute.cs +++ b/PolyShim/Net50/MemberNotNullWhenAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net50/OperatingSystem.cs b/PolyShim/Net50/OperatingSystem.cs index 74f6d616..da21fd68 100644 --- a/PolyShim/Net50/OperatingSystem.cs +++ b/PolyShim/Net50/OperatingSystem.cs @@ -7,8 +7,10 @@ using System; using System.Runtime.InteropServices; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_OperatingSystem { extension(OperatingSystem) { diff --git a/PolyShim/Net50/Process.cs b/PolyShim/Net50/Process.cs index c7ce48c1..eb3d2b09 100644 --- a/PolyShim/Net50/Process.cs +++ b/PolyShim/Net50/Process.cs @@ -10,8 +10,10 @@ using System.Diagnostics; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_Process { #if FEATURE_TASK extension(Process process) diff --git a/PolyShim/Net50/RequiresUnreferencedCodeAttribute.cs b/PolyShim/Net50/RequiresUnreferencedCodeAttribute.cs index c127fa88..ce442ac2 100644 --- a/PolyShim/Net50/RequiresUnreferencedCodeAttribute.cs +++ b/PolyShim/Net50/RequiresUnreferencedCodeAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net50/TaskCompletionSourceOfT.cs b/PolyShim/Net50/TaskCompletionSourceOfT.cs index e29048e6..5a9dea85 100644 --- a/PolyShim/Net50/TaskCompletionSourceOfT.cs +++ b/PolyShim/Net50/TaskCompletionSourceOfT.cs @@ -9,8 +9,10 @@ using System; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_TaskCompletionSourceOfT { extension(TaskCompletionSource source) { diff --git a/PolyShim/Net50/Type.cs b/PolyShim/Net50/Type.cs index 73beeec4..c5b30f8a 100644 --- a/PolyShim/Net50/Type.cs +++ b/PolyShim/Net50/Type.cs @@ -7,8 +7,10 @@ using System; using System.Reflection; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_Type { extension(Type type) { diff --git a/PolyShim/Net50/UIntPtr.cs b/PolyShim/Net50/UIntPtr.cs index f48b0340..314bbda4 100644 --- a/PolyShim/Net50/UIntPtr.cs +++ b/PolyShim/Net50/UIntPtr.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions3 +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net50_UIntPtr { extension(UIntPtr) { diff --git a/PolyShim/Net50/UnconditionalSuppressMessageAttribute.cs b/PolyShim/Net50/UnconditionalSuppressMessageAttribute.cs index dd696fa5..235ca4a5 100644 --- a/PolyShim/Net50/UnconditionalSuppressMessageAttribute.cs +++ b/PolyShim/Net50/UnconditionalSuppressMessageAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net60/ArgumentNullException.cs b/PolyShim/Net60/ArgumentNullException.cs index 97c0b054..36537178 100644 --- a/PolyShim/Net60/ArgumentNullException.cs +++ b/PolyShim/Net60/ArgumentNullException.cs @@ -7,8 +7,10 @@ using System; using System.Runtime.CompilerServices; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_ArgumentNullException { extension(ArgumentNullException) { diff --git a/PolyShim/Net60/EnumerableExtensions.cs b/PolyShim/Net60/EnumerableExtensions.cs index b5081bd8..d2d055c1 100644 --- a/PolyShim/Net60/EnumerableExtensions.cs +++ b/PolyShim/Net60/EnumerableExtensions.cs @@ -6,10 +6,12 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace System.Linq; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_EnumerableExtensions { extension(IEnumerable source) { diff --git a/PolyShim/Net60/Environment.cs b/PolyShim/Net60/Environment.cs index 23a3454f..cba6a8ea 100644 --- a/PolyShim/Net60/Environment.cs +++ b/PolyShim/Net60/Environment.cs @@ -7,8 +7,10 @@ using System; using System.Diagnostics; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_Environment { extension(Environment) { diff --git a/PolyShim/Net60/List.cs b/PolyShim/Net60/List.cs index 72a60d9c..392dd083 100644 --- a/PolyShim/Net60/List.cs +++ b/PolyShim/Net60/List.cs @@ -7,8 +7,10 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_List { extension(List list) { diff --git a/PolyShim/Net60/Math.cs b/PolyShim/Net60/Math.cs index 1e44e447..13da5f14 100644 --- a/PolyShim/Net60/Math.cs +++ b/PolyShim/Net60/Math.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_Math { extension(Math) { diff --git a/PolyShim/Net60/Parallel.cs b/PolyShim/Net60/Parallel.cs index b52267e9..25b5412a 100644 --- a/PolyShim/Net60/Parallel.cs +++ b/PolyShim/Net60/Parallel.cs @@ -11,8 +11,10 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_Parallel { extension(Parallel) { diff --git a/PolyShim/Net60/Random.cs b/PolyShim/Net60/Random.cs index 72db8e23..532b7692 100644 --- a/PolyShim/Net60/Random.cs +++ b/PolyShim/Net60/Random.cs @@ -6,6 +6,7 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; file static class RandomEx { @@ -13,7 +14,8 @@ file static class RandomEx public static Random? Shared { get; set; } } -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_Random { extension(Random random) { diff --git a/PolyShim/Net60/RequiresAssemblyFilesAttribute.cs b/PolyShim/Net60/RequiresAssemblyFilesAttribute.cs index 9d64e3d5..7d2c2d6d 100644 --- a/PolyShim/Net60/RequiresAssemblyFilesAttribute.cs +++ b/PolyShim/Net60/RequiresAssemblyFilesAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NET6_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net60/String.cs b/PolyShim/Net60/String.cs index 2d9a3fac..f67af5cd 100644 --- a/PolyShim/Net60/String.cs +++ b/PolyShim/Net60/String.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_String { extension(string str) { diff --git a/PolyShim/Net60/Task.cs b/PolyShim/Net60/Task.cs index e1010104..c5fd665c 100644 --- a/PolyShim/Net60/Task.cs +++ b/PolyShim/Net60/Task.cs @@ -9,8 +9,10 @@ using System; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net60_Task { extension(Task task) { diff --git a/PolyShim/Net70/ArgumentException.cs b/PolyShim/Net70/ArgumentException.cs index 076a4652..7dd603f2 100644 --- a/PolyShim/Net70/ArgumentException.cs +++ b/PolyShim/Net70/ArgumentException.cs @@ -7,8 +7,10 @@ using System; using System.Runtime.CompilerServices; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_ArgumentException { extension(ArgumentException) { diff --git a/PolyShim/Net70/Byte.cs b/PolyShim/Net70/Byte.cs index 4869f1e2..20a788dc 100644 --- a/PolyShim/Net70/Byte.cs +++ b/PolyShim/Net70/Byte.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Byte { extension(byte) { diff --git a/PolyShim/Net70/DateTime.cs b/PolyShim/Net70/DateTime.cs index f89a4f9c..ab6dbe8f 100644 --- a/PolyShim/Net70/DateTime.cs +++ b/PolyShim/Net70/DateTime.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_DateTime { extension(DateTime) { diff --git a/PolyShim/Net70/DateTimeOffset.cs b/PolyShim/Net70/DateTimeOffset.cs index cbeae6e0..3aba7bff 100644 --- a/PolyShim/Net70/DateTimeOffset.cs +++ b/PolyShim/Net70/DateTimeOffset.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_DateTimeOffset { extension(DateTimeOffset) { diff --git a/PolyShim/Net70/Decimal.cs b/PolyShim/Net70/Decimal.cs index 20144ea5..86cccd5c 100644 --- a/PolyShim/Net70/Decimal.cs +++ b/PolyShim/Net70/Decimal.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Decimal { extension(decimal) { diff --git a/PolyShim/Net70/Double.cs b/PolyShim/Net70/Double.cs index 8cda6698..be034a7c 100644 --- a/PolyShim/Net70/Double.cs +++ b/PolyShim/Net70/Double.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Double { extension(double) { diff --git a/PolyShim/Net70/EnumerableExtensions.cs b/PolyShim/Net70/EnumerableExtensions.cs index 8d5e2523..1d5d3fe7 100644 --- a/PolyShim/Net70/EnumerableExtensions.cs +++ b/PolyShim/Net70/EnumerableExtensions.cs @@ -6,10 +6,12 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace System.Linq; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_EnumerableExtensions { extension(IEnumerable source) { diff --git a/PolyShim/Net70/File.cs b/PolyShim/Net70/File.cs index 20554961..ef6b2004 100644 --- a/PolyShim/Net70/File.cs +++ b/PolyShim/Net70/File.cs @@ -10,8 +10,10 @@ using System.Runtime.CompilerServices; using System.Text; using System.Threading; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_File { // No file I/O on .NET Standard prior to 1.3 #if !NETSTANDARD || NETSTANDARD1_3_OR_GREATER diff --git a/PolyShim/Net70/Int16.cs b/PolyShim/Net70/Int16.cs index b61920d8..e043199c 100644 --- a/PolyShim/Net70/Int16.cs +++ b/PolyShim/Net70/Int16.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Int16 { extension(short) { diff --git a/PolyShim/Net70/Int32.cs b/PolyShim/Net70/Int32.cs index 49b58111..b69db8fd 100644 --- a/PolyShim/Net70/Int32.cs +++ b/PolyShim/Net70/Int32.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Int32 { extension(int) { diff --git a/PolyShim/Net70/Int64.cs b/PolyShim/Net70/Int64.cs index e89c396c..3ada7238 100644 --- a/PolyShim/Net70/Int64.cs +++ b/PolyShim/Net70/Int64.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Int64 { extension(long) { diff --git a/PolyShim/Net70/IntPtr.cs b/PolyShim/Net70/IntPtr.cs index fd0280eb..2bf6c74d 100644 --- a/PolyShim/Net70/IntPtr.cs +++ b/PolyShim/Net70/IntPtr.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_IntPtr { extension(IntPtr) { diff --git a/PolyShim/Net70/Regex.cs b/PolyShim/Net70/Regex.cs index b2030ac6..d98b39db 100644 --- a/PolyShim/Net70/Regex.cs +++ b/PolyShim/Net70/Regex.cs @@ -7,8 +7,10 @@ using System; using System.Text.RegularExpressions; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Regex { extension(Regex regex) { diff --git a/PolyShim/Net70/RequiresDynamicCodeAttribute.cs b/PolyShim/Net70/RequiresDynamicCodeAttribute.cs index 198cdeca..a089e9be 100644 --- a/PolyShim/Net70/RequiresDynamicCodeAttribute.cs +++ b/PolyShim/Net70/RequiresDynamicCodeAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NET7_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net70/SByte.cs b/PolyShim/Net70/SByte.cs index 9b46bc64..94ae700c 100644 --- a/PolyShim/Net70/SByte.cs +++ b/PolyShim/Net70/SByte.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_SByte { extension(sbyte) { diff --git a/PolyShim/Net70/SetsRequiredMembersAttribute.cs b/PolyShim/Net70/SetsRequiredMembersAttribute.cs index 8d59b65c..8c8860cf 100644 --- a/PolyShim/Net70/SetsRequiredMembersAttribute.cs +++ b/PolyShim/Net70/SetsRequiredMembersAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NET7_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net70/Single.cs b/PolyShim/Net70/Single.cs index 70dfc3d8..1d117b35 100644 --- a/PolyShim/Net70/Single.cs +++ b/PolyShim/Net70/Single.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Single { extension(float) { diff --git a/PolyShim/Net70/Stream.cs b/PolyShim/Net70/Stream.cs index 5b1f37b0..f807e2ba 100644 --- a/PolyShim/Net70/Stream.cs +++ b/PolyShim/Net70/Stream.cs @@ -9,8 +9,10 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_Stream { extension(Stream stream) { diff --git a/PolyShim/Net70/StringSyntaxAttribute.cs b/PolyShim/Net70/StringSyntaxAttribute.cs index d8992f3e..6910e1b2 100644 --- a/PolyShim/Net70/StringSyntaxAttribute.cs +++ b/PolyShim/Net70/StringSyntaxAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NET7_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net70/TextReader.cs b/PolyShim/Net70/TextReader.cs index 08b960cc..b8ee98d4 100644 --- a/PolyShim/Net70/TextReader.cs +++ b/PolyShim/Net70/TextReader.cs @@ -10,8 +10,10 @@ using System.Text; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_TextReader { extension(TextReader reader) { diff --git a/PolyShim/Net70/UInt16.cs b/PolyShim/Net70/UInt16.cs index fd553ec8..511c51f7 100644 --- a/PolyShim/Net70/UInt16.cs +++ b/PolyShim/Net70/UInt16.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_UInt16 { extension(ushort) { diff --git a/PolyShim/Net70/UInt32.cs b/PolyShim/Net70/UInt32.cs index a423a723..69a3c30e 100644 --- a/PolyShim/Net70/UInt32.cs +++ b/PolyShim/Net70/UInt32.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_UInt32 { extension(uint) { diff --git a/PolyShim/Net70/UInt64.cs b/PolyShim/Net70/UInt64.cs index c8e26e63..cf8318f2 100644 --- a/PolyShim/Net70/UInt64.cs +++ b/PolyShim/Net70/UInt64.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_UInt64 { extension(ulong) { diff --git a/PolyShim/Net70/UIntPtr.cs b/PolyShim/Net70/UIntPtr.cs index 86259b1d..5a201ef9 100644 --- a/PolyShim/Net70/UIntPtr.cs +++ b/PolyShim/Net70/UIntPtr.cs @@ -7,8 +7,10 @@ using System; using System.Globalization; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net70_UIntPtr { extension(UIntPtr) { diff --git a/PolyShim/Net80/CancellationTokenSource.cs b/PolyShim/Net80/CancellationTokenSource.cs index d28a3be3..8c6d76d4 100644 --- a/PolyShim/Net80/CancellationTokenSource.cs +++ b/PolyShim/Net80/CancellationTokenSource.cs @@ -8,8 +8,10 @@ using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net80_CancellationTokenSource { extension(CancellationTokenSource cts) { diff --git a/PolyShim/Net80/EqualityComparer.cs b/PolyShim/Net80/EqualityComparer.cs index e0fba926..2f3d4284 100644 --- a/PolyShim/Net80/EqualityComparer.cs +++ b/PolyShim/Net80/EqualityComparer.cs @@ -9,7 +9,8 @@ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net80_EqualityComparer { [ExcludeFromCodeCoverage] private class DelegateEqualityComparer(Func equals, Func? getHashCode) diff --git a/PolyShim/Net80/Parallel.cs b/PolyShim/Net80/Parallel.cs index a72f01ac..04fd173e 100644 --- a/PolyShim/Net80/Parallel.cs +++ b/PolyShim/Net80/Parallel.cs @@ -10,8 +10,10 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net80_Parallel { extension(Parallel) { diff --git a/PolyShim/Net80/Random.cs b/PolyShim/Net80/Random.cs index 7a2720eb..13b36b71 100644 --- a/PolyShim/Net80/Random.cs +++ b/PolyShim/Net80/Random.cs @@ -7,8 +7,10 @@ using System; using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net80_Random { extension(Random random) { diff --git a/PolyShim/Net90/Convert.cs b/PolyShim/Net90/Convert.cs index 9ac441a6..efdf7272 100644 --- a/PolyShim/Net90/Convert.cs +++ b/PolyShim/Net90/Convert.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net90_Convert { extension(Convert) { diff --git a/PolyShim/Net90/EnumerableExtensions.cs b/PolyShim/Net90/EnumerableExtensions.cs index 2cea1d0c..53268e11 100644 --- a/PolyShim/Net90/EnumerableExtensions.cs +++ b/PolyShim/Net90/EnumerableExtensions.cs @@ -6,10 +6,12 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace System.Linq; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net90_EnumerableExtensions { extension(IEnumerable source) { diff --git a/PolyShim/Net90/FeatureGuardAttribute.cs b/PolyShim/Net90/FeatureGuardAttribute.cs index d976edcb..6757b854 100644 --- a/PolyShim/Net90/FeatureGuardAttribute.cs +++ b/PolyShim/Net90/FeatureGuardAttribute.cs @@ -1,6 +1,8 @@ #if (NETCOREAPP && !NET9_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable #pragma warning disable CS9216 +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net90/FeatureSwitchDefinitionAttribute.cs b/PolyShim/Net90/FeatureSwitchDefinitionAttribute.cs index 9b4809eb..cc33d017 100644 --- a/PolyShim/Net90/FeatureSwitchDefinitionAttribute.cs +++ b/PolyShim/Net90/FeatureSwitchDefinitionAttribute.cs @@ -1,6 +1,8 @@ #if (NETCOREAPP && !NET9_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable #pragma warning disable CS9216 +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/Net90/File.cs b/PolyShim/Net90/File.cs index 962a0a04..32a12f34 100644 --- a/PolyShim/Net90/File.cs +++ b/PolyShim/Net90/File.cs @@ -8,8 +8,10 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net90_File { // No file I/O on .NET Standard prior to 1.3 #if !NETSTANDARD || NETSTANDARD1_3_OR_GREATER diff --git a/PolyShim/Net90/Task.cs b/PolyShim/Net90/Task.cs index 16d07675..115f05cd 100644 --- a/PolyShim/Net90/Task.cs +++ b/PolyShim/Net90/Task.cs @@ -8,8 +8,10 @@ using System.Collections.Generic; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net90_Task { #if FEATURE_ASYNCINTERFACES extension(Task task) diff --git a/PolyShim/Net90/TimeSpan.cs b/PolyShim/Net90/TimeSpan.cs index 3f77cf1c..f20820d7 100644 --- a/PolyShim/Net90/TimeSpan.cs +++ b/PolyShim/Net90/TimeSpan.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_Net90_TimeSpan { extension(TimeSpan) { diff --git a/PolyShim/NetCore10/AppContext.cs b/PolyShim/NetCore10/AppContext.cs index 68b05d9a..328a4369 100644 --- a/PolyShim/NetCore10/AppContext.cs +++ b/PolyShim/NetCore10/AppContext.cs @@ -11,7 +11,8 @@ using System.Reflection; using System.Runtime.Versioning; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_AppContext { extension(AppContext) { diff --git a/PolyShim/NetCore10/Enum.cs b/PolyShim/NetCore10/Enum.cs index bae7aaa0..03d0d056 100644 --- a/PolyShim/NetCore10/Enum.cs +++ b/PolyShim/NetCore10/Enum.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_Enum { extension(Enum enumValue) { diff --git a/PolyShim/NetCore10/EnumerableExtensions.cs b/PolyShim/NetCore10/EnumerableExtensions.cs index f436d036..edf56ddb 100644 --- a/PolyShim/NetCore10/EnumerableExtensions.cs +++ b/PolyShim/NetCore10/EnumerableExtensions.cs @@ -6,10 +6,12 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace System.Linq; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_EnumerableExtensions { extension(IEnumerable source) { diff --git a/PolyShim/NetCore10/Path.cs b/PolyShim/NetCore10/Path.cs index 1396f940..58cd1e7d 100644 --- a/PolyShim/NetCore10/Path.cs +++ b/PolyShim/NetCore10/Path.cs @@ -7,8 +7,10 @@ using System.IO; using System.Linq; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_Path { extension(Path) { diff --git a/PolyShim/NetCore10/Stream.cs b/PolyShim/NetCore10/Stream.cs index 22ead75c..10bf10d0 100644 --- a/PolyShim/NetCore10/Stream.cs +++ b/PolyShim/NetCore10/Stream.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.IO; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_Stream { extension(Stream source) { diff --git a/PolyShim/NetCore10/String.cs b/PolyShim/NetCore10/String.cs index e60da935..27ce48f8 100644 --- a/PolyShim/NetCore10/String.cs +++ b/PolyShim/NetCore10/String.cs @@ -7,8 +7,10 @@ using System; using System.Linq; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_String { extension(string) { diff --git a/PolyShim/NetCore10/Task.cs b/PolyShim/NetCore10/Task.cs index e427993b..b164e74e 100644 --- a/PolyShim/NetCore10/Task.cs +++ b/PolyShim/NetCore10/Task.cs @@ -11,13 +11,15 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; file static class TaskEx { public static Task CompletedTask { get; } = Task.FromResult(0); } -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_Task { extension(Task) { diff --git a/PolyShim/NetCore10/TaskCompletionSource.cs b/PolyShim/NetCore10/TaskCompletionSource.cs index 5bd27bbe..aa7221e1 100644 --- a/PolyShim/NetCore10/TaskCompletionSource.cs +++ b/PolyShim/NetCore10/TaskCompletionSource.cs @@ -9,8 +9,10 @@ using System; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_TaskCompletionSource { extension(TaskCompletionSource source) { diff --git a/PolyShim/NetCore10/Version.cs b/PolyShim/NetCore10/Version.cs index e2119656..8ad8a3be 100644 --- a/PolyShim/NetCore10/Version.cs +++ b/PolyShim/NetCore10/Version.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore10_Version { extension(Version) { diff --git a/PolyShim/NetCore20/CollectionExtensions.cs b/PolyShim/NetCore20/CollectionExtensions.cs index c5fb79ae..3cb31f01 100644 --- a/PolyShim/NetCore20/CollectionExtensions.cs +++ b/PolyShim/NetCore20/CollectionExtensions.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NETCOREAPP2_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming @@ -7,7 +9,8 @@ namespace System.Collections.Generic; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_CollectionExtensions { // This weird conditional compilation pattern is needed so that List-Signatures.ps1 can pick up // both of the type receivers correctly. diff --git a/PolyShim/NetCore20/Dictionary.cs b/PolyShim/NetCore20/Dictionary.cs index f9d9d972..3c77d7c7 100644 --- a/PolyShim/NetCore20/Dictionary.cs +++ b/PolyShim/NetCore20/Dictionary.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_Dictionary { extension(Dictionary dictionary) where TKey : notnull diff --git a/PolyShim/NetCore20/DictionaryEntry.cs b/PolyShim/NetCore20/DictionaryEntry.cs index 31139645..6310b311 100644 --- a/PolyShim/NetCore20/DictionaryEntry.cs +++ b/PolyShim/NetCore20/DictionaryEntry.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_DictionaryEntry { extension(DictionaryEntry entry) { diff --git a/PolyShim/NetCore20/Enum.cs b/PolyShim/NetCore20/Enum.cs index b324a752..00d03cde 100644 --- a/PolyShim/NetCore20/Enum.cs +++ b/PolyShim/NetCore20/Enum.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_Enum { extension(Enum) { diff --git a/PolyShim/NetCore20/EnumerableExtensions.cs b/PolyShim/NetCore20/EnumerableExtensions.cs index 63f3fef7..ddf81b74 100644 --- a/PolyShim/NetCore20/EnumerableExtensions.cs +++ b/PolyShim/NetCore20/EnumerableExtensions.cs @@ -6,10 +6,12 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace System.Linq; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_EnumerableExtensions { extension(IEnumerable source) { diff --git a/PolyShim/NetCore20/ExcludeFromCodeCoverageAttribute.cs b/PolyShim/NetCore20/ExcludeFromCodeCoverageAttribute.cs index 5e73cb8d..ead0cb78 100644 --- a/PolyShim/NetCore20/ExcludeFromCodeCoverageAttribute.cs +++ b/PolyShim/NetCore20/ExcludeFromCodeCoverageAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NETCOREAPP2_0_OR_GREATER) || (NETFRAMEWORK && !NET40_OR_GREATER) || (NETSTANDARD && !NETSTANDARD2_0_OR_GREATER) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore20/File.cs b/PolyShim/NetCore20/File.cs index c62c15d5..851a5690 100644 --- a/PolyShim/NetCore20/File.cs +++ b/PolyShim/NetCore20/File.cs @@ -10,8 +10,10 @@ using System.Text; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_File { // No file I/O on .NET Standard prior to 1.3 #if !NETSTANDARD || NETSTANDARD1_3_OR_GREATER diff --git a/PolyShim/NetCore20/HashSet.cs b/PolyShim/NetCore20/HashSet.cs index 8209aeeb..e969ce83 100644 --- a/PolyShim/NetCore20/HashSet.cs +++ b/PolyShim/NetCore20/HashSet.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_HashSet { extension(HashSet set) { diff --git a/PolyShim/NetCore20/KeyValuePair.cs b/PolyShim/NetCore20/KeyValuePair.cs index 8e628eee..b4f68252 100644 --- a/PolyShim/NetCore20/KeyValuePair.cs +++ b/PolyShim/NetCore20/KeyValuePair.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_KeyValuePair { extension(KeyValuePair pair) { diff --git a/PolyShim/NetCore20/MatchCollection.cs b/PolyShim/NetCore20/MatchCollection.cs index 47999d19..6642118a 100644 --- a/PolyShim/NetCore20/MatchCollection.cs +++ b/PolyShim/NetCore20/MatchCollection.cs @@ -8,8 +8,10 @@ using System.Collections.Generic; using System.Linq; using System.Text.RegularExpressions; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_MatchCollection { // MatchCollection started implementing IEnumerable in .NET Core 2.0, // but we can't implement an interface with extension methods. diff --git a/PolyShim/NetCore20/Math.cs b/PolyShim/NetCore20/Math.cs index b9f3788c..6b389746 100644 --- a/PolyShim/NetCore20/Math.cs +++ b/PolyShim/NetCore20/Math.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_Math { extension(Math) { diff --git a/PolyShim/NetCore20/Path.cs b/PolyShim/NetCore20/Path.cs index 6def25b1..a3abf699 100644 --- a/PolyShim/NetCore20/Path.cs +++ b/PolyShim/NetCore20/Path.cs @@ -8,8 +8,10 @@ using System; using System.IO; using System.Linq; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_Path { extension(Path) { diff --git a/PolyShim/NetCore20/Queue.cs b/PolyShim/NetCore20/Queue.cs index d6df5bc5..7c8ae65e 100644 --- a/PolyShim/NetCore20/Queue.cs +++ b/PolyShim/NetCore20/Queue.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_Queue { extension(Queue queue) { diff --git a/PolyShim/NetCore20/SortedSet.cs b/PolyShim/NetCore20/SortedSet.cs index 12f2b2de..92c6ec96 100644 --- a/PolyShim/NetCore20/SortedSet.cs +++ b/PolyShim/NetCore20/SortedSet.cs @@ -7,8 +7,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_SortedSet { extension(SortedSet set) { diff --git a/PolyShim/NetCore20/String.cs b/PolyShim/NetCore20/String.cs index 20235366..3a9ba0db 100644 --- a/PolyShim/NetCore20/String.cs +++ b/PolyShim/NetCore20/String.cs @@ -8,8 +8,10 @@ using System; using System.Globalization; using System.Text; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_String { extension(string str) { diff --git a/PolyShim/NetCore20/Task.cs b/PolyShim/NetCore20/Task.cs index 012f3b33..57fedbcc 100644 --- a/PolyShim/NetCore20/Task.cs +++ b/PolyShim/NetCore20/Task.cs @@ -10,8 +10,10 @@ using System.Globalization; using System.Text; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_Task { extension(Task task) { diff --git a/PolyShim/NetCore20/Type.cs b/PolyShim/NetCore20/Type.cs index ba328a7f..f7d17fbd 100644 --- a/PolyShim/NetCore20/Type.cs +++ b/PolyShim/NetCore20/Type.cs @@ -7,8 +7,10 @@ using System; using System.Reflection; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore20_Type { extension(Type type) { diff --git a/PolyShim/NetCore21/DateTime.cs b/PolyShim/NetCore21/DateTime.cs index 26b2a781..ff2a079c 100644 --- a/PolyShim/NetCore21/DateTime.cs +++ b/PolyShim/NetCore21/DateTime.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_DateTime { extension(DateTime) { diff --git a/PolyShim/NetCore21/DateTimeOffset.cs b/PolyShim/NetCore21/DateTimeOffset.cs index 776af2cc..0765053d 100644 --- a/PolyShim/NetCore21/DateTimeOffset.cs +++ b/PolyShim/NetCore21/DateTimeOffset.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions2 +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_DateTimeOffset { extension(DateTimeOffset) { diff --git a/PolyShim/NetCore21/MemoryExtensions.Contains.cs b/PolyShim/NetCore21/MemoryExtensions.Contains.cs index 0046d061..565b2a59 100644 --- a/PolyShim/NetCore21/MemoryExtensions.Contains.cs +++ b/PolyShim/NetCore21/MemoryExtensions.Contains.cs @@ -14,7 +14,7 @@ namespace System; // ReadOnlySpan for older frameworks) does not include the Contains(T) method. This method was added // to the BCL in .NET Core 2.1 / .NET Standard 2.1, but the System.Memory NuGet package doesn't backport it. [ExcludeFromCodeCoverage] -internal static partial class PolyfillExtensions +internal static class MemberPolyfills_NetCore21_MemoryExtensions_Contains { extension(Span span) { diff --git a/PolyShim/NetCore21/MemoryExtensions.cs b/PolyShim/NetCore21/MemoryExtensions.cs index 29e684b7..c261e1bc 100644 --- a/PolyShim/NetCore21/MemoryExtensions.cs +++ b/PolyShim/NetCore21/MemoryExtensions.cs @@ -1,5 +1,7 @@ #if !FEATURE_MEMORY #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming @@ -7,7 +9,8 @@ namespace System; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_MemoryExtensions { extension(T[]? array) { diff --git a/PolyShim/NetCore21/Path.cs b/PolyShim/NetCore21/Path.cs index 0c086b2b..b25dca90 100644 --- a/PolyShim/NetCore21/Path.cs +++ b/PolyShim/NetCore21/Path.cs @@ -7,6 +7,7 @@ using System; using System.IO; +using System.Diagnostics.CodeAnalysis; file static class PathEx { @@ -25,7 +26,8 @@ public static bool IsVolumeSeparator(char c) => #endif } -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_Path { extension(Path) { diff --git a/PolyShim/NetCore21/Random.cs b/PolyShim/NetCore21/Random.cs index 081a2bfd..58d14ddd 100644 --- a/PolyShim/NetCore21/Random.cs +++ b/PolyShim/NetCore21/Random.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_Random { extension(Random random) { diff --git a/PolyShim/NetCore21/Stream.cs b/PolyShim/NetCore21/Stream.cs index bd2333ea..60b1bd4f 100644 --- a/PolyShim/NetCore21/Stream.cs +++ b/PolyShim/NetCore21/Stream.cs @@ -9,8 +9,10 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_Stream { extension(Stream stream) { diff --git a/PolyShim/NetCore21/String.cs b/PolyShim/NetCore21/String.cs index e86ac777..7362ade5 100644 --- a/PolyShim/NetCore21/String.cs +++ b/PolyShim/NetCore21/String.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_String { extension(string str) { diff --git a/PolyShim/NetCore21/TextReader.cs b/PolyShim/NetCore21/TextReader.cs index 57430315..824f5431 100644 --- a/PolyShim/NetCore21/TextReader.cs +++ b/PolyShim/NetCore21/TextReader.cs @@ -9,8 +9,10 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_TextReader { extension(TextReader reader) { diff --git a/PolyShim/NetCore21/TextWriter.cs b/PolyShim/NetCore21/TextWriter.cs index f3e532c9..696db8ad 100644 --- a/PolyShim/NetCore21/TextWriter.cs +++ b/PolyShim/NetCore21/TextWriter.cs @@ -9,8 +9,10 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore21_TextWriter { extension(TextWriter writer) { diff --git a/PolyShim/NetCore30/AllowNullAttribute.cs b/PolyShim/NetCore30/AllowNullAttribute.cs index 17b9b7c6..834aa160 100644 --- a/PolyShim/NetCore30/AllowNullAttribute.cs +++ b/PolyShim/NetCore30/AllowNullAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/DisallowNullAttribute.cs b/PolyShim/NetCore30/DisallowNullAttribute.cs index c2f0011e..141b4315 100644 --- a/PolyShim/NetCore30/DisallowNullAttribute.cs +++ b/PolyShim/NetCore30/DisallowNullAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/DoesNotReturnAttribute.cs b/PolyShim/NetCore30/DoesNotReturnAttribute.cs index 832caee4..b58d1508 100644 --- a/PolyShim/NetCore30/DoesNotReturnAttribute.cs +++ b/PolyShim/NetCore30/DoesNotReturnAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/DoesNotReturnIfAttribute.cs b/PolyShim/NetCore30/DoesNotReturnIfAttribute.cs index 7938e7c6..372d2892 100644 --- a/PolyShim/NetCore30/DoesNotReturnIfAttribute.cs +++ b/PolyShim/NetCore30/DoesNotReturnIfAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/EnumerableExtensions.cs b/PolyShim/NetCore30/EnumerableExtensions.cs index b2bdf29a..b43aa111 100644 --- a/PolyShim/NetCore30/EnumerableExtensions.cs +++ b/PolyShim/NetCore30/EnumerableExtensions.cs @@ -6,10 +6,12 @@ // ReSharper disable PartialTypeWithSinglePart using System.Collections.Generic; +using System.Diagnostics.CodeAnalysis; namespace System.Linq; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore30_EnumerableExtensions { extension(IEnumerable source) { diff --git a/PolyShim/NetCore30/File.cs b/PolyShim/NetCore30/File.cs index cb02f11c..50e5fc9b 100644 --- a/PolyShim/NetCore30/File.cs +++ b/PolyShim/NetCore30/File.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.IO; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore30_File { // No file I/O on .NET Standard prior to 1.3 #if !NETSTANDARD || NETSTANDARD1_3_OR_GREATER diff --git a/PolyShim/NetCore30/MaybeNullAttribute.cs b/PolyShim/NetCore30/MaybeNullAttribute.cs index 06b8e853..b5bab75b 100644 --- a/PolyShim/NetCore30/MaybeNullAttribute.cs +++ b/PolyShim/NetCore30/MaybeNullAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/MaybeNullWhenAttribute.cs b/PolyShim/NetCore30/MaybeNullWhenAttribute.cs index 7b100051..8e31f36a 100644 --- a/PolyShim/NetCore30/MaybeNullWhenAttribute.cs +++ b/PolyShim/NetCore30/MaybeNullWhenAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/NotNullAttribute.cs b/PolyShim/NetCore30/NotNullAttribute.cs index 17c4fcfa..0f66f7da 100644 --- a/PolyShim/NetCore30/NotNullAttribute.cs +++ b/PolyShim/NetCore30/NotNullAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/NotNullIfNotNullAttribute.cs b/PolyShim/NetCore30/NotNullIfNotNullAttribute.cs index 5882a494..5250f0c1 100644 --- a/PolyShim/NetCore30/NotNullIfNotNullAttribute.cs +++ b/PolyShim/NetCore30/NotNullIfNotNullAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/NotNullWhenAttribute.cs b/PolyShim/NetCore30/NotNullWhenAttribute.cs index b91ae1bd..261fbde8 100644 --- a/PolyShim/NetCore30/NotNullWhenAttribute.cs +++ b/PolyShim/NetCore30/NotNullWhenAttribute.cs @@ -1,5 +1,7 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable +using System.Diagnostics.CodeAnalysis; + // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace // ReSharper disable InconsistentNaming diff --git a/PolyShim/NetCore30/OSPlatform.cs b/PolyShim/NetCore30/OSPlatform.cs index 22e191d7..c451e447 100644 --- a/PolyShim/NetCore30/OSPlatform.cs +++ b/PolyShim/NetCore30/OSPlatform.cs @@ -6,8 +6,10 @@ // ReSharper disable PartialTypeWithSinglePart using System.Runtime.InteropServices; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore30_OSPlatform { extension(OSPlatform) { diff --git a/PolyShim/NetCore30/Path.cs b/PolyShim/NetCore30/Path.cs index 9a8c6859..c7b3b3e3 100644 --- a/PolyShim/NetCore30/Path.cs +++ b/PolyShim/NetCore30/Path.cs @@ -8,6 +8,7 @@ using System.IO; using System.Linq; using System.Text; +using System.Diagnostics.CodeAnalysis; file static class PathEx { @@ -19,7 +20,8 @@ public static bool IsDirectorySeparator(char c) => #endif } -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore30_Path { extension(Path) { diff --git a/PolyShim/NetCore30/Process.cs b/PolyShim/NetCore30/Process.cs index 722d211b..0c3e5fc2 100644 --- a/PolyShim/NetCore30/Process.cs +++ b/PolyShim/NetCore30/Process.cs @@ -9,8 +9,10 @@ using System.Diagnostics; using System.Linq; using System.Management; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore30_Process { #if FEATURE_PROCESS && FEATURE_MANAGEMENT extension(Process process) diff --git a/PolyShim/NetCore30/Stream.cs b/PolyShim/NetCore30/Stream.cs index 668f110f..81b1d934 100644 --- a/PolyShim/NetCore30/Stream.cs +++ b/PolyShim/NetCore30/Stream.cs @@ -8,8 +8,10 @@ using System; using System.IO; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore30_Stream { extension(Stream stream) { diff --git a/PolyShim/NetCore30/TextWriter.cs b/PolyShim/NetCore30/TextWriter.cs index 97d9ca9b..216aca5a 100644 --- a/PolyShim/NetCore30/TextWriter.cs +++ b/PolyShim/NetCore30/TextWriter.cs @@ -8,8 +8,10 @@ using System; using System.IO; using System.Threading.Tasks; +using System.Diagnostics.CodeAnalysis; -internal static partial class PolyfillExtensions +[ExcludeFromCodeCoverage] +internal static class MemberPolyfills_NetCore30_TextWriter { extension(TextWriter writer) { diff --git a/PolyShim/PolyfillExtensions.cs b/PolyShim/PolyfillExtensions.cs deleted file mode 100644 index 0488328d..00000000 --- a/PolyShim/PolyfillExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -// ReSharper disable RedundantUsingDirective -// ReSharper disable CheckNamespace -// ReSharper disable InconsistentNaming -// ReSharper disable PartialTypeWithSinglePart - -using System.Diagnostics.CodeAnalysis; - -[ExcludeFromCodeCoverage] -internal static partial class PolyfillExtensions; - -// Additional classes may be necessary to avoid collisions when an extension member -// with the same name is defined for different type within the same extension class. -// See DateTime.UnixEpoch and DateTimeOffset.UnixEpoch for an example. - -[ExcludeFromCodeCoverage] -internal static partial class PolyfillExtensions2; - -[ExcludeFromCodeCoverage] -internal static partial class PolyfillExtensions3; From 398b697a7107d9cde2fbf6d7f6c1d01ca01a2d1f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 18:11:56 +0000 Subject: [PATCH 3/4] Remove redundant ExcludeFromCodeCoverage from nested class Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> --- PolyShim/Net80/EqualityComparer.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/PolyShim/Net80/EqualityComparer.cs b/PolyShim/Net80/EqualityComparer.cs index 2f3d4284..5494b335 100644 --- a/PolyShim/Net80/EqualityComparer.cs +++ b/PolyShim/Net80/EqualityComparer.cs @@ -12,7 +12,6 @@ [ExcludeFromCodeCoverage] internal static class MemberPolyfills_Net80_EqualityComparer { - [ExcludeFromCodeCoverage] private class DelegateEqualityComparer(Func equals, Func? getHashCode) : EqualityComparer { From 2c7828443b0e8c865a204c31a7903f4d5e170246 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Feb 2026 18:25:46 +0000 Subject: [PATCH 4/4] Remove redundant using directives from attribute files Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com> --- PolyShim/Net50/DynamicallyAccessedMembersAttribute.cs | 1 - PolyShim/Net50/MemberNotNullAttribute.cs | 1 - PolyShim/Net50/MemberNotNullWhenAttribute.cs | 1 - PolyShim/Net50/RequiresUnreferencedCodeAttribute.cs | 1 - PolyShim/Net50/UnconditionalSuppressMessageAttribute.cs | 1 - PolyShim/Net60/RequiresAssemblyFilesAttribute.cs | 1 - PolyShim/Net70/RequiresDynamicCodeAttribute.cs | 1 - PolyShim/Net70/SetsRequiredMembersAttribute.cs | 1 - PolyShim/Net70/StringSyntaxAttribute.cs | 1 - PolyShim/Net90/FeatureGuardAttribute.cs | 1 - PolyShim/Net90/FeatureSwitchDefinitionAttribute.cs | 1 - PolyShim/NetCore20/ExcludeFromCodeCoverageAttribute.cs | 1 - PolyShim/NetCore30/AllowNullAttribute.cs | 1 - PolyShim/NetCore30/DisallowNullAttribute.cs | 1 - PolyShim/NetCore30/DoesNotReturnAttribute.cs | 1 - PolyShim/NetCore30/DoesNotReturnIfAttribute.cs | 1 - PolyShim/NetCore30/MaybeNullAttribute.cs | 1 - PolyShim/NetCore30/MaybeNullWhenAttribute.cs | 1 - PolyShim/NetCore30/NotNullAttribute.cs | 1 - PolyShim/NetCore30/NotNullIfNotNullAttribute.cs | 1 - PolyShim/NetCore30/NotNullWhenAttribute.cs | 1 - 21 files changed, 21 deletions(-) diff --git a/PolyShim/Net50/DynamicallyAccessedMembersAttribute.cs b/PolyShim/Net50/DynamicallyAccessedMembersAttribute.cs index d8d514a2..ac629d08 100644 --- a/PolyShim/Net50/DynamicallyAccessedMembersAttribute.cs +++ b/PolyShim/Net50/DynamicallyAccessedMembersAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/Net50/MemberNotNullAttribute.cs b/PolyShim/Net50/MemberNotNullAttribute.cs index 61140ec9..c5674c35 100644 --- a/PolyShim/Net50/MemberNotNullAttribute.cs +++ b/PolyShim/Net50/MemberNotNullAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/Net50/MemberNotNullWhenAttribute.cs b/PolyShim/Net50/MemberNotNullWhenAttribute.cs index 05649aa9..8391dc19 100644 --- a/PolyShim/Net50/MemberNotNullWhenAttribute.cs +++ b/PolyShim/Net50/MemberNotNullWhenAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/Net50/RequiresUnreferencedCodeAttribute.cs b/PolyShim/Net50/RequiresUnreferencedCodeAttribute.cs index ce442ac2..ee6faea2 100644 --- a/PolyShim/Net50/RequiresUnreferencedCodeAttribute.cs +++ b/PolyShim/Net50/RequiresUnreferencedCodeAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/Net50/UnconditionalSuppressMessageAttribute.cs b/PolyShim/Net50/UnconditionalSuppressMessageAttribute.cs index 235ca4a5..9f9a217e 100644 --- a/PolyShim/Net50/UnconditionalSuppressMessageAttribute.cs +++ b/PolyShim/Net50/UnconditionalSuppressMessageAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NET5_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/Net60/RequiresAssemblyFilesAttribute.cs b/PolyShim/Net60/RequiresAssemblyFilesAttribute.cs index 7d2c2d6d..79a31d8a 100644 --- a/PolyShim/Net60/RequiresAssemblyFilesAttribute.cs +++ b/PolyShim/Net60/RequiresAssemblyFilesAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NET6_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/Net70/RequiresDynamicCodeAttribute.cs b/PolyShim/Net70/RequiresDynamicCodeAttribute.cs index a089e9be..d0fafadb 100644 --- a/PolyShim/Net70/RequiresDynamicCodeAttribute.cs +++ b/PolyShim/Net70/RequiresDynamicCodeAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NET7_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/Net70/SetsRequiredMembersAttribute.cs b/PolyShim/Net70/SetsRequiredMembersAttribute.cs index 8c8860cf..ca19de77 100644 --- a/PolyShim/Net70/SetsRequiredMembersAttribute.cs +++ b/PolyShim/Net70/SetsRequiredMembersAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NET7_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/Net70/StringSyntaxAttribute.cs b/PolyShim/Net70/StringSyntaxAttribute.cs index 6910e1b2..ab8240e8 100644 --- a/PolyShim/Net70/StringSyntaxAttribute.cs +++ b/PolyShim/Net70/StringSyntaxAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NET7_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/Net90/FeatureGuardAttribute.cs b/PolyShim/Net90/FeatureGuardAttribute.cs index 6757b854..a33794f9 100644 --- a/PolyShim/Net90/FeatureGuardAttribute.cs +++ b/PolyShim/Net90/FeatureGuardAttribute.cs @@ -1,7 +1,6 @@ #if (NETCOREAPP && !NET9_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable #pragma warning disable CS9216 -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/Net90/FeatureSwitchDefinitionAttribute.cs b/PolyShim/Net90/FeatureSwitchDefinitionAttribute.cs index cc33d017..7d59ddb4 100644 --- a/PolyShim/Net90/FeatureSwitchDefinitionAttribute.cs +++ b/PolyShim/Net90/FeatureSwitchDefinitionAttribute.cs @@ -1,7 +1,6 @@ #if (NETCOREAPP && !NET9_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD) #nullable enable #pragma warning disable CS9216 -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/NetCore20/ExcludeFromCodeCoverageAttribute.cs b/PolyShim/NetCore20/ExcludeFromCodeCoverageAttribute.cs index ead0cb78..ca1cc457 100644 --- a/PolyShim/NetCore20/ExcludeFromCodeCoverageAttribute.cs +++ b/PolyShim/NetCore20/ExcludeFromCodeCoverageAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NETCOREAPP2_0_OR_GREATER) || (NETFRAMEWORK && !NET40_OR_GREATER) || (NETSTANDARD && !NETSTANDARD2_0_OR_GREATER) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/NetCore30/AllowNullAttribute.cs b/PolyShim/NetCore30/AllowNullAttribute.cs index 834aa160..d5162600 100644 --- a/PolyShim/NetCore30/AllowNullAttribute.cs +++ b/PolyShim/NetCore30/AllowNullAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/NetCore30/DisallowNullAttribute.cs b/PolyShim/NetCore30/DisallowNullAttribute.cs index 141b4315..db34bca2 100644 --- a/PolyShim/NetCore30/DisallowNullAttribute.cs +++ b/PolyShim/NetCore30/DisallowNullAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/NetCore30/DoesNotReturnAttribute.cs b/PolyShim/NetCore30/DoesNotReturnAttribute.cs index b58d1508..8554c572 100644 --- a/PolyShim/NetCore30/DoesNotReturnAttribute.cs +++ b/PolyShim/NetCore30/DoesNotReturnAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/NetCore30/DoesNotReturnIfAttribute.cs b/PolyShim/NetCore30/DoesNotReturnIfAttribute.cs index 372d2892..b74ccc09 100644 --- a/PolyShim/NetCore30/DoesNotReturnIfAttribute.cs +++ b/PolyShim/NetCore30/DoesNotReturnIfAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/NetCore30/MaybeNullAttribute.cs b/PolyShim/NetCore30/MaybeNullAttribute.cs index b5bab75b..31a6a1c8 100644 --- a/PolyShim/NetCore30/MaybeNullAttribute.cs +++ b/PolyShim/NetCore30/MaybeNullAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/NetCore30/MaybeNullWhenAttribute.cs b/PolyShim/NetCore30/MaybeNullWhenAttribute.cs index 8e31f36a..b26e2428 100644 --- a/PolyShim/NetCore30/MaybeNullWhenAttribute.cs +++ b/PolyShim/NetCore30/MaybeNullWhenAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/NetCore30/NotNullAttribute.cs b/PolyShim/NetCore30/NotNullAttribute.cs index 0f66f7da..f819898e 100644 --- a/PolyShim/NetCore30/NotNullAttribute.cs +++ b/PolyShim/NetCore30/NotNullAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/NetCore30/NotNullIfNotNullAttribute.cs b/PolyShim/NetCore30/NotNullIfNotNullAttribute.cs index 5250f0c1..93c9c17e 100644 --- a/PolyShim/NetCore30/NotNullIfNotNullAttribute.cs +++ b/PolyShim/NetCore30/NotNullIfNotNullAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace diff --git a/PolyShim/NetCore30/NotNullWhenAttribute.cs b/PolyShim/NetCore30/NotNullWhenAttribute.cs index 261fbde8..325cd6f2 100644 --- a/PolyShim/NetCore30/NotNullWhenAttribute.cs +++ b/PolyShim/NetCore30/NotNullWhenAttribute.cs @@ -1,6 +1,5 @@ #if (NETCOREAPP && !NETCOREAPP3_0_OR_GREATER) || (NETFRAMEWORK) || (NETSTANDARD && !NETSTANDARD2_1_OR_GREATER) #nullable enable -using System.Diagnostics.CodeAnalysis; // ReSharper disable RedundantUsingDirective // ReSharper disable CheckNamespace