This repository was archived by the owner on Sep 25, 2026. It is now read-only.
Repository navigation
[DAM analyzer] Add support for properties and enable more tests - #2390
Merged
Merged
Conversation
vitek-karas
reviewed
Nov 29, 2021
vitek-karas
reviewed
Nov 29, 2021
Comment on lines
+43
to
+45
| // Trimmer and analyzer use different formats for ref parameters | ||
| [ExpectedWarning ("IL2077", nameof (ByRefDataflow) + "." + nameof (MethodWithRefParameter) + "(Type&)", ProducedBy = ProducedBy.Trimmer)] | ||
| [ExpectedWarning ("IL2077", nameof (ByRefDataflow) + "." + nameof (MethodWithRefParameter) + "(ref Type)", ProducedBy = ProducedBy.Analyzer)] |
Member
There was a problem hiding this comment.
Could you add an issue for this. My understand is that we tried to match the C# formatting in warnings, so if there's a discrepancy, it should be treated as a bug in the linker.
vitek-karas
reviewed
Nov 29, 2021
| [ExpectedWarning ("IL2077", nameof (ByRefDataflow) + "." + nameof (MethodWithRefParameter) + "(ref Type)", ProducedBy = ProducedBy.Analyzer)] | ||
| public static void PassRefToField () | ||
| { | ||
| MethodWithRefParameter (ref s_typeWithPublicParameterlessConstructor); |
Member
There was a problem hiding this comment.
Just a general note - I know that linker has issues with ref/out parameters in some cases. We should add a work item to the analyzer about the same.
Basically it reverses data flow direction to a degree....
Member
Author
There was a problem hiding this comment.
I think this is the issue you're referring to, right? #2158
I'll link to it from the analyzer tracking issue.
vitek-karas
approved these changes
Nov 29, 2021
- Rename to 'thisParameter' - Reference issue about ref parameter formatting
vitek-karas
approved these changes
Nov 30, 2021
Member
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
4 tasks done
agocke
pushed a commit
to dotnet/runtime
that referenced
this pull request
Nov 16, 2022
…et/linker#2390) The IOperation tree represents properties as IPropertyReferenceOperation, so we need to handle properties specially (whereas the linker sees calls to the getter/setter directly). Commit migrated from dotnet/linker@d8170a8
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.
I enabled more of the dataflow tests for the analyzer and fixed one common bucket of failures due to properties not being supported in the analyzer. The IOperation tree represents properties as IPropertyReferenceOperation so we need to handle properties specially (whereas the linker sees calls to the getter/setter directly).