This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
Simplify DAM analyzer and add conversion test - #2297
Merged
Merged
Conversation
agocke
reviewed
Sep 29, 2021
| } | ||
|
|
||
| [Fact] | ||
| public Task ConversionOperation () |
Member
There was a problem hiding this comment.
Shouldn't this be in the shared tests?
Member
Author
There was a problem hiding this comment.
It should be, but I think there's still a little work left for us to confidently share tests, so I've put it here for now. I don't think it hurts to have a few analyzer-only tests as a sanity check, as long as we go back and make sure the shared tests have full coverage later.
- Take Location in helper instead of originOperation - Avoid optional parameters - Add test with DAM on conversion return type
mateoatr
approved these changes
Sep 29, 2021
mateoatr
left a comment
Contributor
There was a problem hiding this comment.
Much cleaner/clearer! Thanks!
agocke
approved these changes
Sep 29, 2021
Member
|
If there's still outstanding work for the test integration it would be good to have an issue to track that |
Member
Author
agocke
pushed a commit
to dotnet/runtime
that referenced
this pull request
Nov 16, 2022
* Simplify DAM analyzer and add conversion test * PR feedback - Take Location in helper instead of originOperation - Avoid optional parameters - Add test with DAM on conversion return type * Add success testcase Commit migrated from dotnet/linker@8e7b310
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
@mateoatr I was looking again at the analyzer and saw some opportunity to simplify. I didn't understand why we check for
Conversionoperations specifically at https://github.com/dotnet/linker/blob/feature/damAnalyzer/src/ILLink.RoslynAnalyzer/DynamicallyAccessedMembersAnalyzer.cs#L125so I wrote a test that should show a case where we might want different behavior for a conversion operator.
For now this pipes the
targetIsMethodReturnargument through a few helpers, but soon we should be able to get rid of it and have a uniform representation of the source/target values.