RS1024: fix false positive on object creation#4571
Conversation
| !createdType.TypeArguments.IsEmpty && | ||
| IsSymbolType(createdType.TypeArguments[0], symbolType) && | ||
| !objectCreation.Arguments.Any(arg => IsSymbolType(arg.Type, symbolEqualityComparerType))) | ||
| !objectCreation.Arguments.Any(arg => IsSymbolType(arg.Value, symbolEqualityComparerType))) |
There was a problem hiding this comment.
It's the second similar fix I am doing which makes me question a change on Roslyn.
There was a problem hiding this comment.
Looking at this one right after #4477
There was a problem hiding this comment.
It's the second similar fix I am doing which makes me question a change on Roslyn.
Just to make sure I'm interpreting correctly. You hit these issues while working in Roslyn and are fixing here?
There was a problem hiding this comment.
Sorry no, I meant that this is the second issue raised on roslyn-analyzers related to getting the type on a conversion. I am wondering if the code used to work and it stopped when we have moved to a newer version of Roslyn. My point is to say, maybe there is a regression on Roslyn side regarding these operations (Type wasn't null and now is).
Codecov Report
@@ Coverage Diff @@
## master #4571 +/- ##
==========================================
- Coverage 95.84% 95.81% -0.04%
==========================================
Files 1177 1177
Lines 268257 268257
Branches 16202 16202
==========================================
- Hits 257100 257019 -81
- Misses 9090 9092 +2
- Partials 2067 2146 +79 |
ryzngard
left a comment
There was a problem hiding this comment.
It's unfortunate how easy this mistake was to miss :/. Thanks for fixing!
Fix #4568