Skip to content
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

Use minimal suffix that's distinct from local var names #4481

Merged
merged 3 commits into from
Dec 6, 2023

Conversation

ChrisPenner
Copy link
Contributor

@ChrisPenner ChrisPenner commented Dec 6, 2023

Overview

Fixes: #4480

When disambiguating suffixified names against local variables, rather than just using the FQN we find the smallest viable suffix. This should JustWork™ on Share too.

Implementation notes

Starting with the suffixified name, keep adding segments until we find a name that doesn't conflict with anything locally defined. 99.9% of the time this'll just be a single segment, but it'll fall back all the way to the FQN if necessary.

Interesting/controversial decisions

Nah

Test coverage

See the updates to the regression test for proof :)

@ChrisPenner ChrisPenner marked this pull request as ready for review December 6, 2023 20:49
Copy link
Member

@pchiusano pchiusano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice!

@pchiusano pchiusano added the ready-to-merge Apply this to a PR and it will get merged automatically once CI passes and 1 reviewer has approved label Dec 6, 2023
@ChrisPenner
Copy link
Contributor Author

@pchiusano Thanks for adding the original regression transcript, always makes testing these things so much easier :)

@ChrisPenner ChrisPenner requested a review from aryairani December 6, 2023 20:56
@mergify mergify bot merged commit 5eadbc6 into trunk Dec 6, 2023
7 checks passed
@mergify mergify bot deleted the cp/minimal-local-name-disambiguation branch December 6, 2023 21:16
@mergify mergify bot removed the ready-to-merge Apply this to a PR and it will get merged automatically once CI passes and 1 reviewer has approved label Dec 6, 2023
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.

Use minimally longer unique suffix instead of FQN to disambiguate variables
2 participants