Fix issue with runtime resolve on open generic class#198
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a runtime resolution issue in ProjectionExpressionResolver when resolving [Projectable] members on closed generic type instantiations by ensuring parameter-type name generation is based on the member as declared on the generic type definition (matching the source generator’s naming).
Changes:
- Update runtime reflection-based resolver logic to inspect methods/constructors as declared on the generic type definition when the declaring type is normalized to an open generic definition.
- Add runtime regression tests that mimic generated expression factory types in the test assembly and validate reflection resolution + resolved lambda signatures.
- Add/extend generator snapshot coverage for generic-class methods whose parameters are the class type parameter.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/EntityFrameworkCore.Projectables.Tests/Services/ProjectionExpressionResolverGenericTypeTests.cs | Adds runtime regression tests and hand-crafted “generated” classes to validate reflection resolution on closed generic types. |
| tests/EntityFrameworkCore.Projectables.Generator.Tests/GenericTests.GenericClassMethodsWithTypeParameterParameter.verified.txt | Adds the verified snapshot for generated output of a generic-class method taking the class type parameter. |
| tests/EntityFrameworkCore.Projectables.Generator.Tests/GenericTests.cs | Adds a generator regression test to exercise generic-class methods with type-parameter parameters. |
| src/EntityFrameworkCore.Projectables/Services/ProjectionExpressionResolver.cs | Adjusts reflection resolver to compute parameter type names from the member on the generic type definition (method/ctor). |
tests/EntityFrameworkCore.Projectables.Generator.Tests/GenericTests.cs
Outdated
Show resolved
Hide resolved
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.
No description provided.