Bunch of fixes for CA1859#6418
Merged
Merged
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6418 +/- ##
==========================================
- Coverage 96.15% 96.15% -0.01%
==========================================
Files 1365 1365
Lines 317448 317494 +46
Branches 10263 10269 +6
==========================================
+ Hits 305230 305273 +43
+ Misses 9785 9784 -1
- Partials 2433 2437 +4 |
Youssef1313
reviewed
Jan 7, 2023
Youssef1313
reviewed
Jan 7, 2023
buyaa-n
approved these changes
Jan 8, 2023
buyaa-n
left a comment
There was a problem hiding this comment.
Overall LGTM, thank you! Will wait for the open question resolved before merge
* When using the ?? operator, the nullable annotation for the left-hand operand is now erased. This prevents the analyzer suggesting to use a replacement nullable type rather than its non-nullable variation. * We no longer suggest to upgrade the type of a local/field/parameter if the symbol is being used to invoke a method that's is an explicit implementation of an interface method. If the user would upgrade the type, the call to that method would no longer work. * Ensure that we never recommend upgrading the signature of a method that implements an interface method. * Don't recommend a method to be upgraded if the method is an implementation of a partial method definition. This is because there might be different implementations of the method with conflicting behavior. Note that if you use #if constructs, the diagnostic may still make recommendations that would break your code since the analyzer only knows about the select #if block. * Remove a field-specific optimization that was designed to speed up the analyzer since it actually broke analysis of fields, yielding bogus analysis results.
Member
Member
Author
|
@Youssef1313 Yes, all these issues were fixed. |
This was referenced Jan 17, 2023
Closed
Member
|
Thanks @geeknoid. I went ahead and closed the four issues. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When using the ?? operator, the nullable annotation for the left-hand operand is now erased. This prevents the analyzer suggesting to use a replacement nullable type rather than its non-nullable variation. CA1859 erroneously recommends nullable return type #6413
We no longer suggest to upgrade the type of a local/field/parameter if the symbol is being used to invoke a method that is an explicit implementation of an interface method. If the user would upgrade the type, the call to that method would no longer work. CA1859 improperly handles explicit interface implementations #6416
Ensure that we never recommend upgrading the signature of a method that implements an interface method.
Don't recommend a method to be upgraded if the method is an implementation of a partial method definition. This is because there might be different implementations of the method with conflicting behavior. Note that if you use #if constructs, the diagnostic may still make recommendations that would break your code since the analyzer only knows about the selected #if block. Exclude partial method signatures from CA1859 warnings #6414
Remove a field-specific optimization that was designed to speed up the analyzer, since it actually broke analysis of fields, yielding bogus analysis results. CA1859 erroneously suggests changing return type to one of multiple possible return types #6411