-
Notifications
You must be signed in to change notification settings - Fork 512
Update tests for lambda discard parameters #4056
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
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4056 +/- ##
=======================================
Coverage 97.45% 97.45%
=======================================
Files 989 991 +2
Lines 115570 115626 +56
Branches 3423 3423
=======================================
+ Hits 112632 112688 +56
Misses 1943 1943
Partials 995 995 🚀 New features to boost your workflow:
|
| { | ||
| public void Test() | ||
| { | ||
| Func<int, int, int> handler = (_, _) => 0; |
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.
Irrelevant test, since "handler" is the only variable here?
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.
It's a verification that _ is still ignored when it's treated as a true discard by the compiler. I was torn on whether to keep this test or not considering SA1313 is the one for parameters.
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.
My assumption was that this diagnostic would only analyze "handler", not the discards, but that might be wrong
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.
That's exactly the correct assumption. The question is, considering we can't cover all possible scenarios in all possible cases, where do we draw the line on tests to include for "unrelated items"? This one seems pretty close to the not-worth-it line, but ... 🤷
Only changes tests.
Closes #3977