-
Notifications
You must be signed in to change notification settings - Fork 467
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
Support foreach over parameters in DoNotCopyValue #4374
Conversation
// No special requirements | ||
break; | ||
|
||
case RefKind.RefReadOnly when operation.Syntax is CommonForEachStatementSyntax syntax && operation.SemanticModel.GetForEachStatementInfo(syntax).GetEnumeratorMethod is { IsReadOnly: true }: |
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.
This is getting too difficult to manage - IMO this analyzer is not sustainable unless rewritten as a flow-based analyzer. I'll let you decide how to take this forward.
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.
IMO this analyzer is not sustainable unless rewritten as a flow-based analyzer.
Flow-based analysis does not help here. Every language construct needs to be allow-listed as it is encountered. The only real alternative would be new language support or IL analysis.
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.
At this point, I am not sure my reviews are valuable for this analyzer :-) - the analyzer feels way too complex and syntax/language construct dependent to me.
cc0c258
to
ac5f89f
Compare
Codecov Report
@@ Coverage Diff @@
## master #4374 +/- ##
==========================================
- Coverage 95.79% 95.79% -0.01%
==========================================
Files 1170 1172 +2
Lines 266722 266801 +79
Branches 16063 16069 +6
==========================================
+ Hits 255511 255574 +63
- Misses 9155 9165 +10
- Partials 2056 2062 +6 |
ac5f89f
to
21b4b7c
Compare
Builds on #4368