Skip to content

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Sep 23, 2025

Backport of #119838 to release/10.0-rc2

/cc @jeffhandley @eiriktsarpalis

Customer Impact

  • Customer reported
  • Found internally

Customer reported in: DefaultIfEmptyIterator<TSource>.TryGetElementAt returns _default when not found (dotnet/runtime#119834)

.NET 9 regressed the behavior of the DefaultIfEmpty LINQ method resulting in incorrect results when chained with ElementAtOrDefault using an out of bounds index. This fix has been applied to .NET 11, .NET 10 GA, and .NET 9 Servicing (for the October servicing release). The release/10.0 PR didn't get merged before the RC2 snap, but we should include this fix in RC2 so that 10.0 RC2 and 9.0 servicing are aligned in behavior.

Regression

  • Yes
  • No

The regression was introduced in Consolidate LINQ's internal IIListProvider/IPartition into base Iterator class (#98969).

Testing

Added unit testing verifying the impacted behavior.

Risk

Low. Applies a straightforward fix to a simple bug.

@jeffhandley jeffhandley added this to the 10.0.0 milestone Sep 23, 2025
@jeffhandley jeffhandley self-assigned this Sep 23, 2025
@dotnet-policy-service
Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-linq
See info in area-owners.md if you want to be subscribed.

@jeffhandley jeffhandley added the Servicing-consider Issue for next servicing release review label Sep 23, 2025
@jeffhandley
Copy link
Member

We discussed this during Tactics. We are not going to approve/merge this into RC2 yet as builds are already getting produced. If the window opens up for more items to be merged in for RC2, this would get approved and we would merge it in. /cc @eiriktsarpalis

@jeffhandley
Copy link
Member

Closing this RC2 backport. The 10.0 fix will be present in the GA release.

@jeffhandley jeffhandley added Servicing-rejected and removed Servicing-consider Issue for next servicing release review labels Sep 26, 2025
@jkotas jkotas deleted the backport/pr-119838-to-release/10.0-rc2 branch September 27, 2025 05:30
@github-actions github-actions bot locked and limited conversation to collaborators Oct 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants