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

[API Compat] Adding a new public member to an unsealed public class is not detected as a breaking change #47194

Open
bitbonk opened this issue Feb 28, 2025 · 0 comments

Comments

@bitbonk
Copy link

bitbonk commented Feb 28, 2025

Is your feature request related to a problem? Please describe.

When adding a new public (or protected) member to an existing public class (or struct), these changes are not detected as source breaking changes by the baseline package validator. Such changes are not source compatible because consuming code may have inherited from that type and may have already added a member with the same name and signature and this would result in a CS0108 compiler warning that the inherited member is hidden.

Describe the solution you'd like

Introduce a new validation check that fails when a new public or protected member is added to a unsealed class or struct.

@bitbonk bitbonk changed the title Adding a new public member to an unsealed public class is not detected as a breaking change [API Compat] Adding a new public member to an unsealed public class is not detected as a breaking change Feb 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant