-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[release/8.0-staging] Transform Span-based overloads to Enumerable in funcletizer #35720
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
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fixes dotnet#35100 (cherry picked from commit 6c0106b)
AndriySvyryd
approved these changes
Mar 4, 2025
1 task
This was referenced Jul 22, 2025
Open
This was referenced Jul 28, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backports part of #35339
Fixes #35100
Description
C# 14 (currently in preview) is introducing first-class spans, which changes the Roslyn overload resolution to prefer Span-based overloads in some cases. Unfortunately, the newly selected overloads, which have Span parameters, are unsupported in EF since the LINQ expression tree interpreter is used internally, and it does not support ref structs.
This problem already been fixed for EF 10 in #35339. However, users on older of EF Core who switch to .NET 10/C# 14 will still hit this issue. This PR proposes backporting the fix to EF Core 8.0 to ensure these users aren't affected.
Customer impact
Some very basic query patterns will start failing when trying to use EF Core 8.0 with C# 14, e.g.:
How found
Reported by users on 10.
Regression
Yes, in the combination of EF Core 8.0 and C# 14.
Testing
Older versions of EF aren't tested with later versions of C#/NET; manual testing was performed.
Risk
Very low - very targeted expression tree transformation; added quirk.