Skip to content

9.4 support for rename plugin #3417

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

Merged
merged 1 commit into from
Dec 27, 2022
Merged

9.4 support for rename plugin #3417

merged 1 commit into from
Dec 27, 2022

Conversation

wz1000
Copy link
Collaborator

@wz1000 wz1000 commented Dec 21, 2022

No description provided.

@michaelpj
Copy link
Collaborator

Seems like this PR is making some substantive changes, worth comments?

Comment on lines +81 to +84
let oldNames = (filter matchesDirect indirectOldNames) ++ directOldNames
matchesDirect n = occNameFS (nameOccName n) `elem` directFS
where
directFS = map (occNameFS. nameOccName) directOldNames
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why is this necessary? Is there a case that we were missing?

The only case I am aware of for indirect names is with record field puns, but these should always "match" the direct names since they are, well, puns.

Looks good otherwise - many thanks

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If there are implicit dictionary names (eg $fShow for code like show 1) then we don't want to attempt to rename those.

Copy link
Contributor

Choose a reason for hiding this comment

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

You should mention that you need to filter stuff out since GHC-9.4 because now there are implicit dictionary names like $fShow which we don't want to attempt to rename.

@wz1000 wz1000 added the merge me Label to trigger pull request merge label Dec 27, 2022
@wz1000
Copy link
Collaborator Author

wz1000 commented Dec 27, 2022

Seems like this PR is making some substantive changes, worth comments?

I've added some comments.

@mpickering
Copy link
Contributor

I discussed this with Zubin and asked him to write a comment explaining what was going on with the matchesDirect filtering otherwise looks sensible to me.

@mergify mergify bot merged commit 472947c into master Dec 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Label to trigger pull request merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants