fix: parenthesize upcast when inlining a Use= mapping in a projection#2341
Merged
Conversation
latonz
requested changes
Jul 6, 2026
Contributor
|
Thanks for this fix, I added my feedback 😊 |
Contributor
|
Could you rebase onto main? |
Demivan
force-pushed
the
fix/2340-projection-cast-elision
branch
from
July 6, 2026 09:21
26c3b0d to
2c2a525
Compare
Contributor
Author
|
Rebased it using GitHub rebase button |
Contributor
|
Thank you for this contribution! |
latonz
approved these changes
Jul 6, 2026
latonz
enabled auto-merge (squash)
July 6, 2026 09:24
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.
Parenthesize upcast when inlining a
Use=mapping in a queryable projectionDescription
A queryable projection that inlines a
Use=helper whose parameter is a supertype (interface or base class) of the projected source element generated an upcast without parentheses:Because a parameter identifier binds tighter than a member-access receiver, dropping the helper's body inline reattaches the cast to the wrong subtree. The result either fails to compile or binds the wrong member.
The inliner now parenthesizes a substituted cast when it lands in a receiver position:
Fixes #2340
Checklist