-
Notifications
You must be signed in to change notification settings - Fork 127
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
[DAM analyzer] Add support for properties and enable more tests #2390
Conversation
// 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)] |
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.
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.
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.
Filed #2406
[UnrecognizedReflectionAccessPattern (typeof (ByRefDataflow), nameof (MethodWithRefParameter), new string[] { "Type&" }, messageCode: "IL2077")] | ||
// 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)] | ||
public static void PassRefToField () | ||
{ | ||
MethodWithRefParameter (ref s_typeWithPublicParameterlessConstructor); |
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.
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....
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.
I think this is the issue you're referring to, right? #2158
I'll link to it from the analyzer tracking issue.
- Rename to 'thisParameter' - Reference issue about ref parameter formatting
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
…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
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).