-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
…verifies if the abstract keyword was removed.
src/Compatibility/ApiCompat/Microsoft.DotNet.ApiCompatibility/Resources.resx
Show resolved
Hide resolved
test/Microsoft.DotNet.ApiCompatibility.Tests/Rules/CannotAddOrRemoveVirtualKeywordTests.cs
Outdated
Show resolved
Hide resolved
Does this also account for strict mode in which the API members should be equal? |
…erences invocation.
Good catch, I added a test for strict mode removal of abstract. |
@ViktorHofer @ericstj how does this flow into maintenance-packages? |
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. |
Yes, adding an OOB PackageReference to it in m-p should work. We have done that in the past. |
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