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 CannotReOrderStructProperties rule to API-Compat #37662

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
Next Next commit
re-add the line
  • Loading branch information
ShreyasJejurkar committed Dec 27, 2023
commit b17ed22687430d01dcadfebeb84ae378fa5f6005
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public CannotReOrderStructPublicProperties(IRuleRegistrationContext context)
private void RunOnTypeSymbol(ITypeSymbol? left, ITypeSymbol? right, MetadataInformation leftMetadata, MetadataInformation rightMetadata, IList<CompatDifference> differences)
{
// check if left and right both are struct
if (left != null && right != null)
if (left != null && right != null && left.TypeKind == TypeKind.Struct && right.TypeKind == TypeKind.Struct)
{
// check if left and right both are public
if (left.DeclaredAccessibility == Accessibility.Public && right.DeclaredAccessibility == Accessibility.Public)
Expand Down
Loading