Match Attributes for virtual methods and overrides#2046
Merged
tlakollo merged 16 commits intodotnet:mainfrom Jun 22, 2021
Merged
Match Attributes for virtual methods and overrides#2046tlakollo merged 16 commits intodotnet:mainfrom
tlakollo merged 16 commits intodotnet:mainfrom
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
sbomer
reviewed
May 21, 2021
mateoatr
reviewed
May 21, 2021
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
mateoatr
reviewed
May 25, 2021
mateoatr
reviewed
May 25, 2021
agocke
reviewed
May 26, 2021
| } | ||
|
|
||
| [Fact] | ||
| public Task OverrideHasAttributeButBaseDoesnt () |
Member
There was a problem hiding this comment.
Time to move these tests to a base class, I think -- rather than continue to duplicate tests between RequiresAssemblyFiles and RequiresUnreferencedCode
Member
|
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
Contributor
|
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
agocke
reviewed
Jun 11, 2021
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
agocke
reviewed
Jun 18, 2021
Update documentation, resource and tests
agocke
reviewed
Jun 22, 2021
src/linker/Linker.Steps/ValidateVirtualMethodAnnotationsStep.cs
Outdated
Show resolved
Hide resolved
agocke
reviewed
Jun 22, 2021
Member
agocke
left a comment
There was a problem hiding this comment.
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
agocke
reviewed
Jun 22, 2021
akoeplinger
added a commit
to dotnet/sdk
that referenced
this pull request
Jun 23, 2021
agocke
pushed a commit
to dotnet/runtime
that referenced
this pull request
Nov 16, 2022
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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