-
Notifications
You must be signed in to change notification settings - Fork 470
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
Fix #6640 #6670
base: main
Are you sure you want to change the base?
Fix #6640 #6670
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #6670 +/- ##
==========================================
+ Coverage 96.32% 96.39% +0.07%
==========================================
Files 1389 1379 -10
Lines 325529 322268 -3261
Branches 10729 10460 -269
==========================================
- Hits 313579 310666 -2913
+ Misses 9237 9110 -127
+ Partials 2713 2492 -221 |
.../Microsoft.CodeQuality.Analyzers/ApiDesignGuidelines/OperatorOverloadsHaveNamedAlternates.cs
Outdated
Show resolved
Hide resolved
@@ -99,7 +99,7 @@ private static void AnalyzeSymbol(SymbolAnalysisContext symbolContext) | |||
// don't report a diagnostic on the `op_False` method because then the user would see two diagnostics for what is really one error | |||
// special-case looking for `IsTrue` instance property | |||
// named properties can't be overloaded so there will only ever be 0 or 1 | |||
IPropertySymbol property = typeSymbol.GetMembers(IsTrueText).OfType<IPropertySymbol>().FirstOrDefault(); | |||
IPropertySymbol property = typeSymbol.GetBaseTypesAndThis().SelectMany(x => x.GetMembers(IsTrueText).OfType<IPropertySymbol>()).FirstOrDefault(); |
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 believe this is the case where using a loop with a break on first found match would be more efficient than linq. A local function would also work.
@NewellClark are you able to address the feedback and resolve the merge conflicts? Thanks! |
Looks like the file has changed sufficiently in main that it would be easier for me to simply reimplement this than try to merge. I'll do this tomorrow. |
I've fixed issue #6640, and added unit tests to confirm.