-
Notifications
You must be signed in to change notification settings - Fork 466
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
Check for the CollectionExpression syntax kind early in UseSearchValuesAnalyzer #7279
Check for the CollectionExpression syntax kind early in UseSearchValuesAnalyzer #7279
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7279 +/- ##
==========================================
- Coverage 96.48% 96.48% -0.01%
==========================================
Files 1443 1443
Lines 345375 345376 +1
Branches 11362 11363 +1
==========================================
- Hits 333222 333221 -1
- Misses 9273 9276 +3
+ Partials 2880 2879 -1 |
@CyrusNajmabadi, any idea what's going on here? |
src/NetAnalyzers/CSharp/Microsoft.NetCore.Analyzers/Performance/CSharpUseSearchValues.cs
Outdated
Show resolved
Hide resolved
src/NetAnalyzers/CSharp/Microsoft.NetCore.Analyzers/Performance/CSharpUseSearchValues.cs
Outdated
Show resolved
Hide resolved
Do we have a dump of the failure? |
Here's a memory dump for a build of |
This appears to "resolve" the issue hit in dotnet/runtime#100520 (failures after ingesting #7252)
The issue appears to be that this else block
roslyn-analyzers/src/NetAnalyzers/CSharp/Microsoft.NetCore.Analyzers/Performance/CSharpUseSearchValues.cs
Lines 115 to 120 in e4d7ea6
is now being called with the
@"\/"u8
expression.While this condition will return
false
during theIsConstantByteOrCharCollectionExpression
check,semanticModel.GetOperation(expression)
intermittently fails when buildingSystem.Formats.Tar
(consistently succeeds every second build ?!?).Filtering out the expression kind before the call to
semanticModel.GetOperation
appears to "fix" the issue, but I don't understand whyGetOperation
would be failing like this in the first place 😕We already have analyzer tests for this pattern (property returning utf8 string literals) that are perfectly happy with the current code, so this appears to be something specific to runtime code somehow.
The failing call stack from dotnet/runtime#100520: