diff --git a/ClosedTypeHierarchyDiagnosticSuppressor.Tests/ClosedTypeHierarchyDiagnosticSuppressor.Tests.csproj b/ClosedTypeHierarchyDiagnosticSuppressor.Tests/ClosedTypeHierarchyDiagnosticSuppressor.Tests.csproj index ac2ffcf..0677103 100644 --- a/ClosedTypeHierarchyDiagnosticSuppressor.Tests/ClosedTypeHierarchyDiagnosticSuppressor.Tests.csproj +++ b/ClosedTypeHierarchyDiagnosticSuppressor.Tests/ClosedTypeHierarchyDiagnosticSuppressor.Tests.csproj @@ -8,10 +8,10 @@ - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/ClosedTypeHierarchyDiagnosticSuppressor.sln b/ClosedTypeHierarchyDiagnosticSuppressor.sln index 083717e..c2b3a55 100644 --- a/ClosedTypeHierarchyDiagnosticSuppressor.sln +++ b/ClosedTypeHierarchyDiagnosticSuppressor.sln @@ -8,9 +8,10 @@ EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{60F51DB5-2BCC-4800-93D2-6B8604FD2DDF}" ProjectSection(SolutionItems) = preProject .editorconfig = .editorconfig + global.json = global.json EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ClosedTypeHierarchyDiagnosticSuppressor.Tests", "ClosedTypeHierarchyDiagnosticSuppressor.Tests\ClosedTypeHierarchyDiagnosticSuppressor.Tests.csproj", "{86A9C76C-96A2-4085-BCDF-C92E2CE4019B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ClosedTypeHierarchyDiagnosticSuppressor.Tests", "ClosedTypeHierarchyDiagnosticSuppressor.Tests\ClosedTypeHierarchyDiagnosticSuppressor.Tests.csproj", "{86A9C76C-96A2-4085-BCDF-C92E2CE4019B}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/ClosedTypeHierarchyDiagnosticSuppressor/ClosedTypeHierarchyDiagnosticSuppressor.csproj b/ClosedTypeHierarchyDiagnosticSuppressor/ClosedTypeHierarchyDiagnosticSuppressor.csproj index 819f8c8..d73e933 100644 --- a/ClosedTypeHierarchyDiagnosticSuppressor/ClosedTypeHierarchyDiagnosticSuppressor.csproj +++ b/ClosedTypeHierarchyDiagnosticSuppressor/ClosedTypeHierarchyDiagnosticSuppressor.csproj @@ -2,15 +2,15 @@ netstandard2.0 - true - 10 - enable - - SvSoft.Analyzers.ClosedTypeHierarchyDiagnosticSuppression - <__CurrentYear>$([System.DateTime]::Now.Year) - Copyright (C) Sven Hübner 2022 - $(__CurrentYear) - Sven Hübner - SvSoft.Analyzers.ClosedTypeHierarchyDiagnosticSuppression + true + 10 + enable + + SvSoft.Analyzers.ClosedTypeHierarchyDiagnosticSuppression + <__CurrentYear>$([System.DateTime]::Now.Year) + Copyright (C) Sven Hübner 2022 - $(__CurrentYear) + Sven Hübner + SvSoft.Analyzers.ClosedTypeHierarchyDiagnosticSuppression discriminated unions, match, switch true https://github.com/shuebner/ClosedTypeHierarchyDiagnosticSuppressor @@ -19,21 +19,21 @@ - + - - + + - false - true + false + true - + - + diff --git a/ClosedTypeHierarchyDiagnosticSuppressor/TypeHierarchyHelper.cs b/ClosedTypeHierarchyDiagnosticSuppressor/TypeHierarchyHelper.cs index e9c524a..eeed6cb 100644 --- a/ClosedTypeHierarchyDiagnosticSuppressor/TypeHierarchyHelper.cs +++ b/ClosedTypeHierarchyDiagnosticSuppressor/TypeHierarchyHelper.cs @@ -65,7 +65,9 @@ static bool HasOnlyPrivateConstructorsAndProtectedCopyCtors(INamedTypeSymbol roo (IsRecord(rootCandidate) && rootCandidate.Constructors.All(c => c.DeclaredAccessibility == Accessibility.Private || MatchesImplicitlyCreatedRecordCopyCtor(rootCandidate, c))); +#pragma warning disable CS0162 // Unreachable code detected, FP, see https://github.com/dotnet/roslyn/issues/41429 const string CompilerCreatedCloneMethodNameOnRecordTypes = "$"; +#pragma warning restore CS0162 // Unreachable code detected static bool IsRecord(INamedTypeSymbol recordCandidate) => recordCandidate.MemberNames.Contains(CompilerCreatedCloneMethodNameOnRecordTypes); diff --git a/global.json b/global.json index 37c124f..9068438 100644 --- a/global.json +++ b/global.json @@ -1,5 +1,5 @@ { "sdk": { - "version": "6.0.300" + "version": "6.0.405" } } \ No newline at end of file