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

Add a polyfill to enable newer compiler features #10315

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
limit test to only validating public types
  • Loading branch information
jimmylewis committed Jan 7, 2025
commit fd72729c1f45307ec3272709331f3c02272c2a00
42 changes: 4 additions & 38 deletions tests/NuGet.Services.Contracts.Tests/ContractsFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,44 +19,6 @@ public void ShouldOnlyHaveInterfacesAndEnums()
// included in the assembly by newer language versions
"Microsoft.CodeAnalysis.EmbeddedAttribute",
"System.Runtime.CompilerServices.RefSafetyRulesAttribute",
// generated polyfills from PolySharp
"System.Runtime.CompilerServices.NullableAttribute",
"System.Runtime.CompilerServices.NullableContextAttribute",
"System.Index",
"System.Range",
"System.Runtime.Versioning.RequiresPreviewFeaturesAttribute",
"System.Runtime.CompilerServices.AsyncMethodBuilderAttribute",
"System.Runtime.CompilerServices.CallerArgumentExpressionAttribute",
"System.Runtime.CompilerServices.CollectionBuilderAttribute",
"System.Runtime.CompilerServices.CompilerFeatureRequiredAttribute",
"System.Runtime.CompilerServices.InterpolatedStringHandlerArgumentAttribute",
"System.Runtime.CompilerServices.InterpolatedStringHandlerAttribute",
"System.Runtime.CompilerServices.IsExternalInit",
"System.Runtime.CompilerServices.ModuleInitializerAttribute",
"System.Runtime.CompilerServices.OverloadResolutionPriorityAttribute",
"System.Runtime.CompilerServices.ParamCollectionAttribute",
"System.Runtime.CompilerServices.RequiredMemberAttribute",
"System.Runtime.CompilerServices.RequiresLocationAttribute",
"System.Runtime.CompilerServices.SkipLocalsInitAttribute",
"System.Diagnostics.CodeAnalysis.AllowNullAttribute",
"System.Diagnostics.CodeAnalysis.ConstantExpectedAttribute",
"System.Diagnostics.CodeAnalysis.DisallowNullAttribute",
"System.Diagnostics.CodeAnalysis.DoesNotReturnAttribute",
"System.Diagnostics.CodeAnalysis.DoesNotReturnIfAttribute",
"System.Diagnostics.CodeAnalysis.ExperimentalAttribute",
"System.Diagnostics.CodeAnalysis.MaybeNullAttribute",
"System.Diagnostics.CodeAnalysis.MaybeNullWhenAttribute",
"System.Diagnostics.CodeAnalysis.MemberNotNullAttribute",
"System.Diagnostics.CodeAnalysis.MemberNotNullWhenAttribute",
"System.Diagnostics.CodeAnalysis.NotNullAttribute",
"System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute",
"System.Diagnostics.CodeAnalysis.NotNullWhenAttribute",
"System.Diagnostics.CodeAnalysis.SetsRequiredMembersAttribute",
"System.Diagnostics.CodeAnalysis.StringSyntaxAttribute",
"System.Diagnostics.CodeAnalysis.UnscopedRefAttribute",
"System.Index+ThrowHelper",
"System.Range+HashHelpers",
"System.Range+ThrowHelper",
};

// Act
Expand All @@ -66,6 +28,10 @@ public void ShouldOnlyHaveInterfacesAndEnums()
Assert.NotEmpty(types);
foreach (var type in types)
{
if (!type.IsVisible)
{
continue;
}
if (exclude.Contains(type.FullName))
{
continue;
Expand Down