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

Conversation

ShreyasJejurkar
Copy link

@ShreyasJejurkar ShreyasJejurkar commented Dec 27, 2023

  1. This PR adds a new rule to API-Compat tooling where it will issue a diagnosis if the struct properties are re-ordered.

Fixes #26460

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-ApiCompat untriaged Request triage from a team member labels Dec 27, 2023
@KalleOlaviNiemitalo
Copy link
Contributor

"Compat" rather than "Compact"

@ShreyasJejurkar ShreyasJejurkar changed the title Add CannotReOrderStructProperties rule to API-Compact Add CannotReOrderStructProperties rule to API-Compat Dec 27, 2023
@ShreyasJejurkar

This comment was marked as outdated.

@KalleOlaviNiemitalo
Copy link
Contributor

The order of fields matters in sequential-layout types (which can be classes too, not just structs) but this PR currently checks the order of properties.

@ShreyasJejurkar
Copy link
Author

The order of fields matters in sequential-layout types (which can be classes too, not just structs) but this PR currently checks the order of properties.

Ohh ok. Issue states for struct, so am targeting that now and already facing issues. 😅. But I will have look into this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-ApiCompat untriaged Request triage from a team member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API Compat] add rule to make sure struct fields follow LayoutKind
2 participants