-
Notifications
You must be signed in to change notification settings - Fork 126
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
Match Attributes for virtual methods and overrides #2046
Conversation
method or override doesn't Use IL2046 to display errors for RUC Use IL3003 to display errors for RAF Add IL3003 to error-codes.md Add tests
Add support for properties and events Add more tests Use a single resource for different requiresattributes Change error code IL3003 to be generic to requiresattributes
} | ||
|
||
[Fact] | ||
public Task OverrideHasAttributeButBaseDoesnt () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Time to move these tests to a base class, I think -- rather than continue to duplicate tests between RequiresAssemblyFiles and RequiresUnreferencedCode
I'm surprised not to see any tests being unskipped for the linker -- since we should be running the analyzer over the linker tests I assumed we would be seeing those warnings now |
Add test with explicit interface implementation
discussed in dotnet#2077 Now interfaces matching are lookup on types instead of asking per member Added support for specifying in Expected Warning and LogContains where the diagnostic is spected to be produced by default is LinkerAndAnalyzer Renaming methods and classes to specify Requires instead of RequiresUnreferencedCode Merge branch 'main' of https://github.com/mono/linker into MatchOverrideAttributes
I see you added some of the changes discussed in #2077, could we get these in a separate PR to make it easier to review 😄? |
Add Explicit Interface testing
PR comments
Create test were the attributes between metadata and source dont match
following the implementation of ObsoleteAttribute messages Verify in linker tests that the warnings for base and derived methods are generated correctly Add new warnings to error-codes.md Add new resource messages Missing testing on interface/implementation on linker
interfaces, changed from LogContains to ExpectedWarning to find the error codes easier Change condition for linker to ask about interfaces instead of asking if a method is virtual
…ideAttributes Add diagnostics to shared resource file
Update documentation, resource and tests
src/linker/Linker.Steps/ValidateVirtualMethodAnnotationsStep.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the tests still need to move to a base class
src/linker/Linker.Steps/ValidateVirtualMethodAnnotationsStep.cs
Outdated
Show resolved
Hide resolved
PR Comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add analyzer logic to create a diagnostic if attributes don't match between all interface implementations or overrides Use IL2046 to display errors for RUC Use IL3003 to display errors for RAF Add IL3003 to error-codes.md Add tests Adds support for nullable attribute operations Add support for adding metadata information into the compilation Divide the current warning message into 4 different more insightful diagnostic messages following the structure implemented in ObsoleteAttribute messages Add IL2046 to diagnostic format to ILLink.Shared Commit migrated from dotnet/linker@a07cab7
Add analyzer logic to detect when a method has RUC or RAF but its base method or override method doesn't
Use IL2046 to display errors for RUC
Use IL3003 to display errors for RAF
Add IL3003 to error-codes.md
Add tests
Fixes #1985