Skip to content

Commit

Permalink
tech: suppress FP analyzer warning
Browse files Browse the repository at this point in the history
  • Loading branch information
shuebner committed Jan 31, 2023
1 parent 8cb71c6 commit e62409a
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<Clone>$";
#pragma warning restore CS0162 // Unreachable code detected

static bool IsRecord(INamedTypeSymbol recordCandidate) =>
recordCandidate.MemberNames.Contains(CompilerCreatedCloneMethodNameOnRecordTypes);
Expand Down

0 comments on commit e62409a

Please sign in to comment.