Repository navigation
fix: fully qualify explicit lambda return types in inlined expressions - #2499
Merged
Merged
Conversation
A lambda with an explicit return type, such as `.Select(DateTime? (x) => x.DateCreated)`, kept its return type as written when the user-implemented mapping was inlined into a projection. The generated code has no usings, so the type did not resolve. Co-Authored-By: Claude <noreply@anthropic.com>
latonz
requested changes
Nov 21, 2026
latonz
left a comment
Contributor
There was a problem hiding this comment.
Thank you for this contribution, I added my feedback.
latonz
approved these changes
Nov 21, 2026
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.
fix: fully qualify explicit lambda return types in inlined expressions
Description
A lambda with an explicit return type inside a user-implemented mapping method kept that type as written when Mapperly inlined the method into a queryable projection. The generated code has no
usingdirectives, so a type likeDateTime?did not resolve and the generated mapper failed to compile.Mapperly now writes the return type with its full name, the same as other type names in an inlined expression. Nullable annotations are preserved, including on reference types and type arguments.
Source:
Before:
After:
No related issue.
Checklist