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

[ApiCompat] Warn if abstract keyword is removed from member #46797

Merged
merged 4 commits into from
Feb 18, 2025

Conversation

carlossanlop
Copy link
Member

Fixes #46794

Removing the abstract keyword from a member should be disallowed by ApiCompat, but it currently does not know how to handle that case like it used to in the old version.

The lack of warning in ApiCompat caused the introduction of this bug in maintenance-packages System.Reflection.DispatchProxy: dotnet/maintenance-packages#194 which we fixed with dotnet/maintenance-packages#202

@carlossanlop carlossanlop self-assigned this Feb 12, 2025
@carlossanlop carlossanlop requested a review from a team as a code owner February 12, 2025 22:47
@dotnet-issue-labeler dotnet-issue-labeler bot added the untriaged Request triage from a team member label Feb 12, 2025
@ViktorHofer
Copy link
Member

Does this also account for strict mode in which the API members should be equal?

@carlossanlop carlossanlop removed the untriaged Request triage from a team member label Feb 13, 2025
@carlossanlop
Copy link
Member Author

Does this also account for strict mode in which the API members should be equal?

Good catch, I added a test for strict mode removal of abstract.

@carlossanlop carlossanlop enabled auto-merge (squash) February 18, 2025 19:11
@carlossanlop carlossanlop merged commit 88832fb into dotnet:main Feb 18, 2025
38 of 40 checks passed
@carlossanlop carlossanlop deleted the ApiCompatAbstract branch February 18, 2025 22:50
@carlossanlop
Copy link
Member Author

@ViktorHofer @ericstj how does this flow into maintenance-packages?

@ericstj
Copy link
Member

ericstj commented Feb 24, 2025

Either through a new SDK, or we can selectively update the APICompat package. We have to be careful in updating the APICompat package in case it references a newer set of dependencies that are available in the SDK used by m-p.

What we've said in the past is we wanted to keep m-p on the LTS SDK- which would mean we need to backport this change to 8.0.4xx. Not sure we want to do that with this fix, since it will create a new warning for existing customers.

@ViktorHofer
Copy link
Member

Yes, adding an OOB PackageReference to it in m-p should work. We have done that in the past.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ApiCompat] Not catching removal of abstract keyword
3 participants