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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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
CreateType(" abstract class", " public abstract void F();"),
CreateType(" abstract class", " public virtual void F() {}"),
false,
new CompatDifference[] { }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit:

Suggested change
new CompatDifference[] { }
CreateDifferences()

@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
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