Skip to content

Conversation

@CyrusNajmabadi
Copy link
Member

Fixes #62673

context.ReportDiagnostic(Diagnostic.Create(Descriptor, nextInvocation.Syntax.GetLocation()));
// For `Where(x => x is not null).First()` fade out the `First()` portion as we're effectively trimming off
// the last unnecessary chunk.
using var additionalUnnecessaryLocations = TemporaryArray<Location>.Empty;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it easy to add a test for this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moving to a different test harness, yes :'(

@CyrusNajmabadi CyrusNajmabadi merged commit 1c7b495 into dotnet:main Nov 24, 2025
27 checks passed
@CyrusNajmabadi CyrusNajmabadi deleted the simplifyLinq branch November 24, 2025 20:41
@dotnet-policy-service dotnet-policy-service bot added this to the Next milestone Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make IDE0120 (simplify LINQ expression) a suggestion by default

2 participants