Skip to content

Elide conversion of receiver, extension or inline map, trailing implicit args, in DropForMap #23416

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

som-snytt
Copy link
Contributor

@som-snytt som-snytt commented Jun 24, 2025

Fixes #23409

If map is added to a type by conversion, consider dropping the conversion when dropping a map call.

Similarly, it doesn't matter if the method is an extension or inline: drop the map and preserve the nominal receiver.

@som-snytt
Copy link
Contributor Author

som-snytt commented Jun 30, 2025

Handling inlined map at inlining works better.

Edit: working on that.

Edit: actually no, it's fine in DropForMap; at some point I just decided to lift out the reference to the binding of the receiver.

@som-snytt
Copy link
Contributor Author

The related PR because I had to read the code:

#23448

"It's not bad code, it's just a style choice."

@som-snytt som-snytt force-pushed the issue/23409-for-map branch from c121bd8 to 02fa81e Compare July 31, 2025 04:10
@som-snytt som-snytt changed the title Elide conversion of receiver in DropForMap Elide conversion of receiver, extension or inline map, trailing implicit args, in DropForMap Jul 31, 2025
@som-snytt
Copy link
Contributor Author

som-snytt commented Jul 31, 2025

I broke the one debug-preview test. This map is now eliminated: for x <- list yield x, as the sip promises IIUC.

I didn't study the debug test yet. The test run saw the SO in community_c as well. Edit: also community_b. At least it fails very fast.

Edit: Green check on test, but just missed the boat on debug-preview, as it is no longer preview.

@som-snytt som-snytt force-pushed the issue/23409-for-map branch from e9b0078 to 8691c9d Compare July 31, 2025 12:02
@som-snytt som-snytt marked this pull request as ready for review July 31, 2025 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression: betterFors doesn't remove trailing map
1 participant
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy