Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes runtime resolution failures for C# 14 extension members when the receiver type is generic (especially closed generics), by ensuring the generated expression-factory type names match what the runtime resolver computes.
Changes:
- Update generated class naming to strip all
global::occurrences (including within generic argument lists) when sanitizing parameter type names. - Teach the generator to promote generic extension-block type parameters/constraints onto the generated
Expression<T>()factory method. - Add unit, generator snapshot, and functional regression tests covering closed/open generic extension receivers (incl. constraints).
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/EntityFrameworkCore.Projectables/Services/ProjectionExpressionClassNameGenerator.cs | Strips every global:: occurrence during parameter-type name sanitization to avoid generator/runtime name mismatches. |
| src/EntityFrameworkCore.Projectables.Generator/Interpretation/ProjectableInterpreter.BodyProcessors.cs | Applies extension-block type parameters when no method-level type parameters were found. |
| src/EntityFrameworkCore.Projectables.Generator/Interpretation/ProjectableInterpreter.cs | Refactors constraint clause construction to a shared helper. |
| src/EntityFrameworkCore.Projectables.Generator/Interpretation/ProjectableInterpreter.Helpers.cs | Adds extension-block type parameter promotion + shared BuildConstraintClause helper. |
| tests/EntityFrameworkCore.Projectables.Tests/Services/ProjectionExpressionClassNameGeneratorTests.cs | Adds unit coverage for global:: stripping inside generic type arguments. |
| tests/EntityFrameworkCore.Projectables.Generator.Tests/ExtensionMemberTests.cs | Adds generator snapshot tests for generic receiver extension members (closed/open/with constraint). |
| tests/EntityFrameworkCore.Projectables.Generator.Tests/*.verified.txt | Adds snapshots validating emitted code for new generator tests. |
| tests/EntityFrameworkCore.Projectables.FunctionalTests/ExtensionMembers/GenericWrapper.cs | Adds a simple generic wrapper entity used by functional regression tests. |
| tests/EntityFrameworkCore.Projectables.FunctionalTests/ExtensionMembers/EntityExtensions.cs | Adds extension-member definitions for closed/open generic wrappers. |
| tests/EntityFrameworkCore.Projectables.FunctionalTests/ExtensionMembers/ExtensionMemberTests.cs | Adds functional regression tests for closed/open generic receiver extension members. |
| tests/EntityFrameworkCore.Projectables.FunctionalTests/ExtensionMembers/*.verified.txt | Adds SQL snapshots for the new functional tests (net10). |
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
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.
Fixes #195